mail() command help
Posted 06 June 2006 - 01:37 AM
I am using the mail() function/command. whenever I Put mail($recipient, $subject, $message, $from) I have a problem with the $from variable. The email sends. The problem I am having is if my email was email@example.com when I receive the email it says it is from test. It seems to drop everything else. When I look at the return email, the proper email does show up => firstname.lastname@example.org. What am I missing if my variable $from = "email@example.com";
Also, is there a way to have it send "John Smith" <firstname.lastname@example.org>??
Any help would be great.
Thank you in advance
Posted 06 June 2006 - 01:53 AM
$headers = "From: John Smith <email@example.com>\r\n"; mail($to, $subject, $message, $headers)
Posted 06 June 2006 - 02:17 AM
Actually the 4th argument is not "from", but the optional headers.
$headers = "From: John Smith <firstname.lastname@example.org>\r\n"; mail($to, $subject, $message, $headers)[/quote]
Worked like a charm! Thanks
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users