Jump to content

mail () forth paramater


djp1988

Recommended Posts

Hiya, I have this:mail($to, $subject, $body, $head);the $head is: $head = "From: Mysite";I have a sie which is hosted on a mates server, and then my site on my server and when I use the mail(); from his server the FROM information in the emails i get is what I have writen "From: Mysite" but from my server I get: Mysite@p3slh083.shr.phx3.secureserver.netWhy is one server sending the information I want and the other insisting on the @.......secureserver.net ??It is quite annoying to have this long FROM information as I do forward some of the emails to someone and they get lost with it all, so it's easier to just have FROM: mysite for it to be more clear.Can anyone explain and help me?

Link to comment
Share on other sites

First, "mysite" isn't a valid from address, it needs to be a valid email address. I don't know if you're using that as an example or what, but it needs to be a valid address. If you want to show a name you can use this format:Name <user@domain.com>Some mail servers will only send mail where the from address matches the domain that it's coming from. Your other server might be set up to only allow from addresses from that actual server.

Link to comment
Share on other sites

No I actually used the title of the site on one server and it did what i wanted, and on the other server the from info was the ....@....secureserver.com

Link to comment
Share on other sites

Yes, but it depends on the restrictions of the mail server. Some will allow you to send badly formed headers, while others won't. Also note that your email is more likely to be marked "spam" if the from address is badly formed.

Link to comment
Share on other sites

Try using something like this (format taken from the W3S topic subscription notification):

John Doe <john@doe.com>

That should be both human- and machine-readable.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...