Jump to content

problem when using mail()


bluetoother
 Share

Recommended Posts

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...