473,416 Members | 1,729 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

when PHPmailer is used mail goes to junk why?

mikek12004
200 100+
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
2 5854
kenobewan
4,871 Expert 4TB
Suggest checking out the FAQs & tutorials on this site:

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

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

Similar topics

2
by: Andre Phandana | last post by:
Hi, I tried to send email from my server using mail() but the email goes to @xyz.com junk mail folders. Why is that so? How can I fix it? Thank you, --Andre Phandana
1
by: crescent_au | last post by:
I am developing a simple mailing system. This requires sending emails in HTML format to one or more recipient. I am currently using PHP's mail() function. It works alright but it doesn't seem...
2
by: prasenjit2007 | last post by:
Hello, can u help me sending Email with attachments using the Class phpMailer. On the website I have a link to an html form in which I input the parameters with the names 1)from(textbox name)...
32
by: Joe | last post by:
I am just starting to use Object Oriented PHP coding, and I am seeing quite often the following (this example taken from a wiki): $wakka =& new Wakka($wakkaConfig); What exactly is the =&, and...
6
by: =?Utf-8?B?TMOhemFybw==?= | last post by:
Hi everyone I've a simple ASP.NET Page that send a email using smtclient. The server is a Exchange and use my credentials to autentificated. The problem is that the send mail appear in the...
2
by: pradeep | last post by:
Hello All, I use PHPMailer with my SMTP server mail.demo.com I changed my mail server to mail.demo.com to mail.anotherdemo.com So, i replaced mail.demo.com by mail.anotherdemo.com similarly...
7
dlite922
by: dlite922 | last post by:
I can't seem to get it working with my smtp server. I can send the email through the command line like so: 220 localhost.localdomain ESMTP Sendmail 8.13.8/8.13.8; Wed, 6 Aug 2008 18:44:29...
5
by: Gilles Ganault | last post by:
Hello To handle an occasionnal flaky ADSL connection, I updated the database that handles incoming calls to have a column that is set to NULL, and then updated to either Y or N depending on...
5
by: jeddiki | last post by:
I am building my subscriber list which is held in the mySQL database "client" table and I want to start sending them a newsletter. My list will probably get up to around 20,000 I would like...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.