PDA

View Full Version : Not my Email 'From' address


MarkW
04-26-2001, 07:36 AM
I'm generating a confirmation email using PHP mail().
The email generates/sends ok, but the 'From' address ALSO contains 'Ad@zoomer.futurequest.net'. How do I get rid of this?

My code is:
$message = "My message to you...";
$to = $cemail;
$sender = "me@mysite.com";
$replyto = "me@mysite.com";
$subject = "About...";
mail($to, $subject, $message, "From: $sender\nReply-To: $replyto");

Thanks
Mark

Terra
04-26-2001, 09:11 AM
make sure that any names with spaces are quoted:

John Doe <john.doe@acme.com>

should be:
&quot;John Doe&quot; <john.doe@acme.com>

otherwise QMail will take the second part &quot;Doe&quot; as unqualified and add the server default FQDN (fully qualified domain name)...[nbsp][nbsp]This is an effort to ensure RFC822 compliance for messaging format...

Most email clients handle this for you automatically, but programming API's let you speak the protocol in a much more raw mode...

In other words - it doesn't correct your formatting mistakes for you...

--
Terra
--Garbage In - Garbage Out--
FutureQuest

MarkW
05-01-2001, 08:43 AM
Thank you Terra.

I inadvertently had a space in the sender's email address.