Sending mails using PHP turns out to be junk mails

software development


Hi everyone,

I use phpmailer class for my small application of just mailing. When I test it, the mails are delivered to gmail and yahoo with no problem(they are not treated as junk mail) however, when I receive those mails with thunderbird, they are treated as junk mail. I guess thunderbird think thunderbird thinks some email headers are suspicious. what can I do for this problem? my code:

$mail = new PHPMailer();
$mail->From = "";
$mail->Subject = "You have a message from ".$from;
$mail->Body = “hi my friend! this message uses html entities !”;
$mail->AltBody=“hi my friend! \n\n this message uses html entities, but you prefer plain text !”;
$mail->WordWrap = 50;

if(!$mail->Send()) {
$error = “Message was not sent”;
$error .= "
Mailer Error: " . $mail->ErrorInfo;
}else {
$error = “Message has been sent”;


I don’t know nearly enough about the internals of Thunderbird to provide much help there, but I do know that a “new” install of Thunderbird defaults to blocking virtually everything until it is “trained”.

I just ran across this “feature” last week when moving a client off of O*tlook to Thunderbird.

You might get more info on this from the Mozilla forums; I would think this has come up over there before. Good Luck!