473,669 Members | 2,452 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP Mailer to Junk Folder

ddtpmyra
333 Contributor
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 4700
code green
1,726 Recognized Expert Top Contributor
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 Recognized Expert Expert
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 Recognized Expert Top Contributor
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
6509
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 this, but I need to figure out a way to 'send the emails in the background' - ie: if an administrator adds a job to Wyoming, I don't want them to have to wait for the php script to finish selecting and e-
2
5310
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, ReplyTo, FromName, ToName, MailerPath, BCCEmail, Attachement) Set Mailer = Server.CreateObject("Persits.MailSender") if NOT isObject(Mailer) Then Mail = false Exit function
14
3516
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 Hotmail, using different domain sender names, different sending IPs, different SMTP servers, etc., different email text, and I still can't find out why Hotmail blocks so many good emails and throws them in the junk folder. The sending IP even has...
4
6599
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 send, which should fail if the return address is not valid, but I'm still getting the junk. The block looks like this: Set Mailer = Server.CreateObject("SMTPsvg.Mailer") Mailer.RemoteHost = "smtp.xxx.com" Mailer.FromName =...
2
2710
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 be greatly appreciated.
6
5933
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 junk email folder. Any idea. Thanks
6
26362
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 not to pardner with Earthlink and create their own IP. Since then everything email has been broke. Sprint/Embarq is the only copper wire DSL provider where I live.
2
5210
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 being sent to Junk folder of the recepients. 1) The mail contains only plain text, it doen't have things like images or something which is treated as a SPAM or junk. 2) Since the mails are being sent to the internal mail ID's in the office,...
0
8383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8895
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8809
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8588
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.