Jump to content

E-Mail's from mail() have extra "." at end


Cynix

Recommended Posts

I'm currently building a mail library for a script I'm working on, and I've been having some trouble with PHP E-Mails. In a nut shell this is what I have:

[code]
$to = "myemail@mysite.com";
$from = "someone@somewhere.com";
$from_display = "Someone <someone@somewhere.com>";
$subject = "Some Subject";
$message =
"Some Message
This is a message I am sending to myself to test with

Thank you,
The end";
$header_string = "From: $from_display\r\nReply-To: $from\r\nX-Mailer: X7C3/PHP/".phpversion()."\r\n";
mail($to,$subject,$message,$header_string);
[/code]

The E-Mail sends fine, but when I view it in Thunderbird I get an extra dot at the end for some reason, for example:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
Some Message
This is a message I am sending to myself to test with

Thank you,
The end


.
[/quote]

Just like that I get two newlines and a dot appended to my E-Mail message. In my webmail clients the dot does not appear at all. The additions are added both when I send it using sendmail on localhost with PHP's built in mail function and when I use my webhost's SMTP server (raw connection not channeled through mail()).

I think the most likely cause is that I'm missing some important stuff from the headers above or something like that, so if you know anything about E-Mail maybe you could look at it and let me know, or if you can think of anything that might be causing it. I don't get the dot on other PHP E-Mails (such as the signup E-Mail for this forum).
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.