bluetoother Posted September 18, 2007 Share Posted September 18, 2007 i noticed when i send email via php mail() functionto my yahoo or hotmail email for testingthe From field in the email is filled with the name of the host serverthat hosts my web sitebut i want the specified "From" field that i inserted in the head section in mail functionto be shown as the sender of the emailany body know how to solve this matter ? Link to comment Share on other sites More sharing options...
user4fun Posted September 18, 2007 Share Posted September 18, 2007 this is the format that i use and it works just fine, i think the from section has to be a valid exsisting email address on your server for it to work.( so i have read some where) $to = "info@i-s-a-f-e.com"; // OR you could use $to = $email <-- if the email is in the variable $email$headers = "From: small business search engine <community@i-s-a-f-e.com>\r\n";$headers .= 'Reply-To: Community <community@i-s-a-f-e.com>';$title = "Your stuff";$body = <<< emailbodyHere is the message you are trying to sendvaraiable are written in this format$varhave a great dayemailbody;$success = mail($to,$title,$body,$headers); Link to comment Share on other sites More sharing options...
justsomeguy Posted September 18, 2007 Share Posted September 18, 2007 You can specify the from address with a header, it can be any address you want. Check the reference for examples:http://www.php.net/manual/en/function.mail.php Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.