[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

email from php form going getting filtered as spam

Posted on 2009-04-23
18
Medium Priority
?
746 Views
Last Modified: 2013-12-17
Hello,

I am sending a verification email to my new users and I am having an issue with it getting filtered out on gmail and a couple others but it does delver to some.

I would love any pointers.
$subject = "dd.com || User Varification";
    $message = "
Dear $first_name $last_name,
    
Thank you for registering!
    
You are two steps away from joining dd.com.
    
To activate your membership,
please click here: http://www.dd.com/activate.php?id=$userid&code=$db_password
    
Once you activate your memebership, you will be able to login with the following information:
 
Username: $username
Password: $random_password
    
Thank you,
dd.com Staff
    
This is an automated response, please do not reply!"; 
    mail($email_address, $subject, $message, 
        "From: dd.com <mg@dd.com>\n" );

Open in new window

0
Comment
Question by:movieprodw
  • 9
  • 3
  • 3
  • +2
18 Comments
 
LVL 2

Expert Comment

by:Benji_
ID: 24220867
Ensure that your email address is a VALID email address and if a  test mail was sent it would be able to verify.

also check your reverse records are also valid

:D
0
 
LVL 3

Expert Comment

by:Craybe
ID: 24221275
I agree with Benji generally the problem is that you don't have a proper HELO it may be using root@localhost or the like.

If you are using your own webserver I would advise you change your sendmail outgoing mail host.  If it isn't contact the help desk for your webserver and they may be able to assist you with the problem.

Sorry I can't be more help but your code appears to be solid, I think it is just a server problem.
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24221888
I am using info@myhost.com

does that sound wrong?
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 2

Expert Comment

by:Benji_
ID: 24224567
if you email info@yourhost.com  does the email arrive at an inbox or is that box not createD?
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24237073
Hello,

I talked with my server and they said that they set a SPR or something that will make it so that it will work?

I will let you know.

Thanks for your tips!
0
 
LVL 20

Expert Comment

by:NerdsOfTech
ID: 24237519
Also double check the spelling. A lot of people don't know this but SPAM FILTERS keep an eye out for MISSPPEEELLLINGS :) Especially in the SUBJECT

Avoid using special characters like PIPE '|'
"Verification"
I would suggest using this subject instead

$subject = "Email Validation - Thank you for registering with dd.com";
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24237528
I will try that!

It is still getting blocked and that could be it
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24237659


I did change the subject and still nothing. So I copied and pasted the email into my mail program and sent it from my computer using the same email/subject/message and it worked just fine

I have the email below, please let me know if you see anything.
Dear Bob Lastname,
 
Thank you for registering!
 
You are two steps away from joining dd.com.
 
To activate your membership,
please click here: http://www.dd.com/activate.php?id=16&code=4437b6b428875aacbf3cf40c97f7c96d
 
Once you activate your membership, you will be able to log in with the following information:
 
User name: Matt
Password: 914hjv7p
 
Thank you,
dd.com Staff
 
This is an automated response, please do not reply!

Open in new window

0
 
LVL 20

Expert Comment

by:NerdsOfTech
ID: 24237697
maybe it is your from address? to short?

noreply@dd.com would be a better from address maybe?
0
 
LVL 20

Accepted Solution

by:
NerdsOfTech earned 500 total points
ID: 24237704
I agree with the other experts. it sounds like the email server is the issue then.
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24237870
I got some interesting info from the log!
Email from = anonymous@555-55-555-55.dedicated.abac.net
 
[Sun Apr 26 14:51:17 2009] [error] [client 64.150.178.3] PHP Notice: Undefined index: msg in /var/www/vhosts/dd.com/httpdocs/index.php on line 4
[Sun Apr 26 14:55:15 2009] [error] [client 72.201.141.63] PHP Notice: Undefined variable: first_name in /var/www/vhosts/dd.com/httpdocs/join_form.php on line 6
[Sun Apr 26 14:55:15 2009] [error] [client 72.201.141.63] PHP Notice: Undefined variable: last_name in /var/www/vhosts/dd.com/httpdocs/join_form.php on line 10
[Sun Apr 26 14:55:15 2009] [error] [client 72.201.141.63] PHP Notice: Undefined variable: email_address in /var/www/vhosts/dd.com/httpdocs/join_form.php on line 14
[Sun Apr 26 14:55:15 2009] [error] [client 72.201.141.63] PHP Notice: Undefined variable: username in /var/www/vhosts/dd.com/httpdocs/join_form.php on line 18
[Sun Apr 26 14:55:15 2009] [error] [client 72.201.141.63] PHP Notice: Undefined variable: info in /var/www/vhosts/dd.com/httpdocs/join_form.php on line 21
[Sun Apr 26 14:55:27 2009] [error] [client 72.201.141.63] PHP Notice: Undefined variable: pass in /var/www/vhosts/dd.com/httpdocs/registration.php on line 98, referer: http://dd.com/login.phpdd.com

Open in new window

0
 
LVL 3

Assisted Solution

by:Craybe
Craybe earned 500 total points
ID: 24237924
I may be way off target here but is it possible that your php form is being abused?

In your PHP do you have any functions that check for the use of "content-type:", "charset=", "mime-version:", "multipart/mixed", "cc:", "bcc:" in the variables received for email?  These can be used to send spam using the sendmail on your server which could lead to you being blacklisted on spam servers such as spamhaus (or the gmail equivalent).  If you are blacklisted you could find that that is what is causing your emails to be bounced as spam.

When an email gets filtered as spam do you receive a server message letting you know why?  Or is there anything attached to the email at the receivers end that lists the reason for it being blocked, even if it is just server gibberish?

note:  I just checked your websites ip 67.207.67.21 in a majority of spam blacklists and you appear clear, but it is still something to be careful of.  Perhaps you would be best with a new PHP email script.  I have listed the full script I wrote for all of my php email forms at http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_24331507.html  (last answer) perhaps give it a try as it may be something in your php method causing the problem.
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24239018
Ok, so I tried craybe's script and could not get it to work so I decieded that if I authenticated the SMTP then it would have to work right!

I installed pear on my server and ran the script below, once again, it goes to my some emails but still gets blocked from hotmail, google, yahoo!

Any suggestions would be appreciated!
// include PEAR mail classes
include('Mail.php');
 
 
$recipients = "mg@dd.com";
$headers["From"] = "ddemail@dd.com";
$headers["To"] = "mg@dd.com";
$headers["Subject"] = "User feedback";
$mailmsg = "Hello, This is a test.";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "mail.dd.com";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "ddemail@dd.com";
$smtpinfo["password"] = "dd";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);

Open in new window

0
 
LVL 2

Assisted Solution

by:Benji_
Benji_ earned 500 total points
ID: 24239664
Spam checks from your domain are NOT going to take affect straight away it takes between 7 -28days for the system to unblock your domain aslong as your emails arriving in correct format and no one is using your domain to spam.

Hope this helps:D
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24240684
Ok but I own a domain and its getting blocked from that one also, its extremely unlikely that any spammer has spammed my own account.

And don't you think its odd that I can send a domain an email using the same account from my email at it works but not from my script?
0
 
LVL 26

Assisted Solution

by:jar3817
jar3817 earned 500 total points
ID: 24250370
Can you get your hands on the headers of one of these messages? Like send it to your own gmail account or something. It'll be really helpful to see what the message looks like on the receiving end.

I was going to suggest using the pear mail package, but I see from a couple posts above you're already using it.

Are you trying to deliver these message directly to the recipients or sending to your hosting company's relay server first? If not, I'd suggest forwarding to their relay and let it deliver the messages.
0
 
LVL 1

Author Comment

by:movieprodw
ID: 24269422
Hello,

I am sending it from my smtp through the pear script.

Jar mentioned sending it through the hosting relay server, how would I do that?
0
 
LVL 1

Author Closing Comment

by:movieprodw
ID: 31584726
Thanks for all your help, it is still doing it but I have just routed my emails around the issue.

Thanks again!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …
Suggested Courses
Course of the Month20 days, 6 hours left to enroll

873 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