Solved

php mail spam

Posted on 2011-09-03
6
319 Views
Last Modified: 2012-05-12
Hello,

Does anything here stand out that would make this email rejected by spam?

$headers  = 'MIME-Version: 1.0' . "\r\n";
	$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
	$headers .= 'From: a Online Inquiry <noReply@a.com>' . "\r\n";
	$headers .= 'BCC: a <info@a.com>' . "\r\n";
	$headers .= 'Reply-to: '.$name.' <'.$email.'>' . "\r\n";
	$subject='a Online Inquiry';

	$body = "<strong>".$name." is contacting us about your ".$row['year']." ".$row['make']." ".$row['model']." for sale.</strong>
	<br /><hr><br />";
	if($phone){
	$body .= "<strong>Phone:</strong> ".$phone."<br />";
	}
	$body .= "<strong>Email:</strong> ".$email."<br />
	<strong>Message:</strong> ".$message."<br /><br />
	<strong>Vehicle:</strong> ".$row['year']." ".$row['make']." ".$row['model']."<br />
	<strong>Link To Ad:</strong> ".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]."<br />";

	$body = preg_replace("#(?<!\r)\n#si", "\r\n", $body);
	$headers = preg_replace('#(?<!\r)\n#si', "\r\n", $headers); 
	mail($to, $subject, $body, $headers);

Open in new window

0
Comment
Question by:movieprodw
6 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 100 total points
Comment Utility
<noReply@a.com>  Are you really using 'noReply'?  Sending from a non-existent email address will get you bounced at a lot of email servers.  The 'reputation' of your mail server can affect it too.

Spam scoring and rejection is done at the receiving end.  Mail servers set up their spam criteria differently so it is hard to predict what is going to cause your email to be rejected unless someone tells you why.
0
 
LVL 2

Assisted Solution

by:jnfsmile
jnfsmile earned 100 total points
Comment Utility
Maybe because it looks like an automated sales message.

Sender might do it - Do you own "a.com" or is that an example?

The problem might be with the mail sending server and not in the code. Try to check this out.
0
 
LVL 34

Assisted Solution

by:Beverley Portlock
Beverley Portlock earned 100 total points
Comment Utility
Get hold of the rejected email. Most scanners attach an analysis like this

Content analysis details:   (7.6 points, 4.3 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
 0.6 NO_REAL_NAME           From: does not include a real name
 0.9 UNDISC_RECIPS          Valid-looking To "undisclosed-recipients"
 0.9 MSGID_FROM_MTA_ID      Message-Id for external message added locally
 0.5 DNS_FROM_RFC_ABUSE     RBL: Envelope sender in abuse.rfc-ignorant.org
 1.4 DNS_FROM_RFC_POST      RBL: Envelope sender in
                            postmaster.rfc-ignorant.org
 3.4 FORGED_MUA_OUTLOOK     Forged mail pretending to be from MS Outlook

Open in new window


Failing that, install spamassassin and run your email through it.
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 100 total points
Comment Utility
In addition to the other very good suggestions here, you might want to see if your hosting company is adding its own headers to your mail.  Many hosting companies do that, so they can catch spammers and throw them out of the system.  You can see if this is happening by sending an email to your own GMail test address and looking at the information in "Show original" so that you can see the headers.

You might also want to learn about the SPF and be sure it is implemented for your domain.
http://www.openspf.org/

And even better yet, learn about Constant Contact.  Unfailingly successful and embarrassingly inexpensive.
http://www.constantcontact.com

Best regards, ~Ray
0
 
LVL 13

Assisted Solution

by:LinuxGuru
LinuxGuru earned 100 total points
Comment Utility
Also make sure to set proper rdns (Reverse dns) to the mail ip. You can ask your hosting provider to set the rdns for the mail ip.
0
 
LVL 1

Author Closing Comment

by:movieprodw
Comment Utility
Thank you for the tips guys
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now