Make php custom mail form show an email NOT the host servers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

jramaro wrote:They say thats the best wya to learn , kinda sit and pick out the info thats flyin back and forth.
I think the best way to learn is to be a part of the debates rather than just spectating. You can't be proven wrong (or right) until you've put your opinion into the mix. DevNet is about teaching those who don't know, and sharpening the minds of those who do.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

For those who've joined this thread with an attitude problem can we just remember that we're talking to real people here please? 8O

Ok, naughty bits over and done with, using SMTP isn't the fix directly ;) That's just a protocol. It's the headers which matter and the headers are set by the user in the mail() function. The problem with mail() is that it's cocky and will try to screw around with your headers. mail() on linux systems calls sendmail in a mode which makes it difficult to identify who you are, resulting in some odd headers dependent upon the server configuration.

The fix is to either use Swift Mailer as has been suggested, or to fiddle with the command line flags for sendmail:

I forget the ordering of the first parameters, but the last one (5th) is for additional flags.

Code: Select all

mail(...... , "-oi -fyour-real@address.com");
Post Reply