June 29th, 2000, 07:01 PM
I have a script which is using the mail function, mail($mailTo, $mailsujet, $mailbody, $mailhead);
The script work fine but when I received the message, the address is from: email@example.com
the address of my provider and not my domain. I want firstname.lastname@example.org in the header..
Any suggestions on how to fix this?
June 29th, 2000, 07:43 PM
The mail function will automatically using the web-access-name on ur server, if u want do more tricks, try use the mime_mail class.
It's easy to find a open source class.
June 29th, 2000, 10:21 PM
I had a similar problem. Let your header equeal the following. This worked for me.
Let the $from be the email address you want to show up when they open their mail. Let me know if it works.
$mailhead = "From:t $from";
June 29th, 2000, 11:16 PM
I learned a few tricks with the mail function.
That's correct to use the $mailhead as previously described. In addition theres another method that allow a string to be attached to an e-mail address similar to a label. Use the following for this:
$from = "email@example.com";
$mailhead = "From: CompanyName <$from>";
This will show CompanyName in the recieved mail under FROM but reply's will be sent to the e-mail address within the <$from> tag. This is a nice way to personalize e-mail. Some consider the e-mail address itself under the FROM as kind of ugly but it's your choice.