473,386 Members | 1,621 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,386 software developers and data experts.

PHP Mailer to Junk Folder

ddtpmyra
333 100+
Below is the scripts that triggered everytime users update the database and send a blast of emails to the user group. The problem is the email goes to JUNK folder and I wonder though I use the company STMP and company email.

Any idea how to this happened?
Expand|Select|Wrap|Line Numbers
  1. #email process starts here
  2. require("class.phpmailer.php");
  3. $mail = new PHPMailer();
  4. $mail->From     = "xxx@xxx.com";
  5. $mail->FromName = "adminr";
  6. $mail->Subject = "New Document";
  7. $mail->Host     = "xx.xx.x.x"; // SMTP server
  8. $mail->Mailer   = "smtp";
  9.  
  10. $query ="SELECT * FROM members" ;
  11.  
  12. $result=@MYSQL_QUERY($query);
  13. while ($row = mysql_fetch_array ($result)) {
  14.             // HTML body
  15. $body  = "Hello <font size=\"4\">" . $row["fname"] . "</font>, <p>";
  16. $body .= " <font size=\"4\"> A NEWdocument is now available for your review" . $row["fileid"] ."</font><p>";
  17. $body .= "Thank You, <br>";
  18. $body .= "Administrator";
  19.  
  20. / Plain text body (for mail clients that cannot read HTML)
  21. $text_body  = "Hello " . $row["fname"] . ", \n\n";
  22. $text_body .= "New document is now available for your review.\n \n";
  23. $text_body .= "Thank You, \n";
  24. $text_body .= "Administrator";
  25.  
  26. $mail->Body    = $body;
  27. $mail->AltBody = $text_body;
  28. $mail->AddAddress($row["email"], $row["fname"]);
  29.  
  30. if(!$mail->Send())
  31. echo "There has been a mail error sending to " . $row["email"] . "<br>";
  32. // Clear all addresses and attachments for next loop
  33. $mail->ClearAddresses();
  34. $mail->ClearAttachments();
  35. }
  36.  
Jun 4 '09 #1
3 4683
code green
1,726 Expert 1GB
I think you'll find this is down to the filter settings on the receiving email application.
You cannot tamper with a receiver's email settings but you can try to beat the filter.

To avoid emails going to junk or being flagged as spam the content needs adjusting.
This is a fairly dynamic subject but just one word can condemn the email.
A study of this subject is recommended.

Another problem can be attachments. Try zipping them.
Jun 5 '09 #2
Atli
5,058 Expert 4TB
I would also reconsider the subject of your mail. Try making it more... like an actual sentence.

Meaning; instead of "New document", try something like "There is a new document ready for you.".

And, also,it's best to use "\r\n" for line-breaks in emails.
Jun 5 '09 #3
dlite922
1,584 Expert 1GB
It also has to do with the reputation of the sender's mail server/domain accounts.

I know hotmail junks it if the domain is new and doesn't have an SPF record.

DNSstuff.com use to have a good checking mechanism but that site is not free anymore. That's what I used to correct all the non-standard setting about my domain and mail records.

Also, make sure the email is structured (i.e. has headers, from address, etc).

After all this, then worry about words in your email or attachments.

Good luck,




Dan
Jun 5 '09 #4

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

Similar topics

8
by: Good Man | last post by:
Hi I'm building a 'job posting' site of sorts. When a job is available in a particular state, I want the system to send an email to everyone who is 'watching' that state. I know how to do...
2
by: John Davis | last post by:
What is the **MOST** obvious reason why will this will fail (it's not syntax or anything specific to the object)? Function Mail(MailerProgram, Message, Subject, Format, FromEmail, ToEmail,...
14
by: HB | last post by:
As many of us know, when we send legitimate emails to real customers from our apps, those emails often end up in the Hotmail (and MSN -- and AOL, too) junk folder. I've done a lot of testing with...
4
by: =?Utf-8?B?TWlrZSBI?= | last post by:
I'm using a block of ASP to allow a user to send a form via e-mail. However, someone keeps sending me spam through this form and they're using a bogus return address. I'm testing for a successful...
2
by: sweetpotatop | last post by:
Hi, I have been using "Mail" in ASP.NET to send email, however, email deliveries to the Junk-Email of the receiver. Is there a way to get around this please? Thanks in advance. Your help will...
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...
6
by: Dave Kelly | last post by:
Sorry for the long post, it is easier to discard information than to have to wait for it to arrive. So here goes: This code worked perfectly when I was an Earthlink customer. Sprint decided...
2
by: tiijnar | last post by:
Hi Friends, I Have written a java code to send mails to some receipients.It sends to internal mail ID's in the office. An SMTP server has been provided to me. But the problem is that the mails are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.