Connecting Tech Pros Worldwide Forums | Help | Site Map

when PHPmailer is used mail goes to junk why?

mikek12004's Avatar
Familiar Sight
 
Join Date: Sep 2008
Location: Athens, Greece
Posts: 188
#1: Dec 18 '08
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?

kenobewan's Avatar
Moderator
 
Join Date: Dec 2006
Posts: 4,745
#2: Dec 18 '08

re: when PHPmailer is used mail goes to junk why?


Suggest checking out the FAQs & tutorials on this site:

PHPMailer
mikek12004's Avatar
Familiar Sight
 
Join Date: Sep 2008
Location: Athens, Greece
Posts: 188
#3: Dec 18 '08

re: when PHPmailer is used mail goes to junk why?


first thing I checked nothing of help (plus my code is identical to that of the tutorials)
Reply


Similar IIS / Microsoft Internet Information Services bytes