Dear All,
I have created a form and PHP script to send our emails from my website hosted on Hostgator shared package.
The emails went out fine however the problem for me is that when received these mails are showing that they were sent from the web hosting admin email (admin@gator375.hostgator.com). I would like it to show that it came from my email address and get rid of that hostgator address. Any advise or instructions?
Looking forward to your assistance.
thanks
Dave Evan
Web host email Address in PHP Mail
Moderator: General Moderators
Re: Web host email Address in PHP Mail
I assume you send the mail with php's mail function? Maybe your provider's SMTP server fills in certain fields if you don't explicitly specify them yourself. Try sending the mail like this:
Code: Select all
function SendMail( $toAddress, $subject, $body, $fromAddress )
{
$headers = "From: $fromAddress\r\nReply-to: $fromAddress\r\nReturn-path: $fromAddress";
return mail($toAddress,$subject,$body,$headers,"-f$fromAddress");
}
SendMail( "your@momma.com", "Hello!", "Happy birthday mom", "dave@yourwebsite.com" );Re: Web host email Address in PHP Mail
Hi Apolo,
Thanks, with some slight modification I got it to work.
Thks again, appreciated.
Dave Even
Thanks, with some slight modification I got it to work.
Thks again, appreciated.
Dave Even
Re: Web host email Address in PHP Mail
Neat. Just curious, what did you have to change?