sungpeng Posted April 28, 2009 Share Posted April 28, 2009 $headers = 'From: sungpeng <admin@sungpeng.com>' . "\r\n"; mail("$email", "Thank you for registration", "Dear $firstname $lastname, Thank you for registering. Below you will find your username and password that will let you log in and begin to enter rental listings. Username: $email Password: $randompass ", $headers); Result From: myhosting@myhostingplan.com Sent: 28 April 2009 15: 51PM To: ali@msn.com Check can myhostingplan.com change to my domain.com, in this case change to sungpeng.com? Quote Link to comment https://forums.phpfreaks.com/topic/155947-email-coding-enquiry/ Share on other sites More sharing options...
sungpeng Posted April 28, 2009 Author Share Posted April 28, 2009 Amend Result From: myhosting@myhostingplanprovider.com Sent: 28 April 2009 15: 51PM To: ali@msn.com Last time I thought by adding a header can solve the problem, but now it still there? Quote Link to comment https://forums.phpfreaks.com/topic/155947-email-coding-enquiry/#findComment-820912 Share on other sites More sharing options...
nadeemshafi9 Posted April 28, 2009 Share Posted April 28, 2009 its just a header it can change to anything it just for the mail client to read, the real data is coded by the mail server. Quote Link to comment https://forums.phpfreaks.com/topic/155947-email-coding-enquiry/#findComment-820926 Share on other sites More sharing options...
premiso Posted April 28, 2009 Share Posted April 28, 2009 $headers = 'From: sungpeng <admin@sungpeng.com>' . "\r\n"; mail("$email", "Thank you for registration", "Dear $firstname $lastname, Thank you for registering. Below you will find your username and password that will let you log in and begin to enter rental listings. Username: $email Password: $randompass ", $headers, "-fadmin@sungpeng.com"); Give that a try. The 5th parameter takes the -f which sets the from at the command line level. A lot of hosts require this to be set to official change the "from" address. Granted it is still good to put it in the header as well. Quote Link to comment https://forums.phpfreaks.com/topic/155947-email-coding-enquiry/#findComment-821069 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.