By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,454 Members | 1,804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,454 IT Pros & Developers. It's quick & easy.

when PHPmailer is used mail goes to junk why?

mikek12004
100+
P: 200
Before posting here I google it and saw ablut 30 pages for a solution so I pretty much excluded the obvious things. The code is
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.     //now to send the mails to seller
  3.     require("class.phpmailer.php");
  4.     $mail = new PHPMailer();
  5.     //$mail->IsSMTP(); // telling the class to use SMTP
  6.     //$mail->Host = "smtp.example.com"; // SMTP server
  7.     $from = "vasilis@emile.com";
  8.     $mail->From = $from;
  9.     $mail->FromName = "Mike Kypriotis";
  10.     $mail->AddAddress("mike@emile.gr","Mike");
  11.     //$mail->AddAddress("customers@generalmusic.gr");
  12.  
  13.     //$mail->IsSendmail();  // telling the class to use Sendmail
  14.     //$mail->Sendmail = "/usr/sbin/sendmail"; // send mail executables
  15.  
  16.     $mail->IsHTML(true); 
  17.     $mail->Subject = "Test Request ";
  18.     $body="This is a test mail22 <a href='http://www.yahoo.com'>here</a>";
  19.  
  20.     $mail->Body =$body;
  21.  
  22.     $mail->AltBody="Hello, my friend! \n\n This message uses HTML entities, but you prefer plain text !"; 
  23.  
  24.     if(!$mail->Send())
  25.     {
  26.            //echo 'Message was not sent.';
  27.            //echo 'Mailer error: ' . $mail->ErrorInfo;
  28.         echo "Error outlook Sending";
  29.     }
  30.     else
  31.     {
  32.       echo "Send to outlook OK";
  33.     }
  34. //now to send the mails to seller
  35.  
  36.     $mail = new PHPMailer();
  37.     //$mail->IsSMTP(); // telling the class to use SMTP
  38.     //$mail->Host = "smtp.example.com"; // SMTP server
  39.     $from = "mike@emile.com";
  40.     $mail->From = "mike@emile.com";
  41.     $mail->FromName = "Hans Pollaerts ";
  42.     $mail->AddAddress("mike_k12003@yahoo.gr","Mike");
  43.     //$mail->AddAddress("customers@generalmusic.gr");
  44.  
  45.     //$mail->IsSendmail();  // telling the class to use Sendmail
  46.     //$mail->Sendmail = "/usr/sbin/sendmail"; // send mail executables
  47.  
  48.     $mail->IsHTML(true); 
  49.     $mail->Subject = "Test Request ";
  50.  
  51.     $body="This is a test mail 22<a href='http://www.yahoo.com'>here</a>";
  52.  
  53.     $mail->Body =$body;
  54.  
  55.     $mail->AltBody="Hello, my friend! \n\n This message uses HTML entities, but you prefer plain text !"; 
  56.  
  57.     if(!$mail->Send())
  58.     {
  59.            //echo 'Message was not sent.';
  60.            //echo 'Mailer error: ' . $mail->ErrorInfo;
  61.         echo "Error yahoo Sending";
  62.     }
  63.     else
  64.     {
  65.       echo "Send to yahoo OK";
  66.     }
  67.  
  68. ?>
  69.  
Tried with mail sendmail,smtp the same. The from and to address are valid I even tried putting a name to the AddAddress and adding an email in "<>"in the From field. (eg. Mike Kyros <mike@yahoo.gr>)
My body has hyperlinks but even if removed it will go to the junk
The IP of the server where the script is not blacklisted
Any suggestions?
Dec 18 '08 #1
Share this Question
Share on Google+
2 Replies


kenobewan
Expert 2.5K+
P: 4,871
Suggest checking out the FAQs & tutorials on this site:

PHPMailer
Dec 18 '08 #2

mikek12004
100+
P: 200
first thing I checked nothing of help (plus my code is identical to that of the tutorials)
Dec 18 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.