Link to home
Start Free TrialLog in
Avatar of gpinzino
gpinzino

asked on

Email issue - Sends to some addresses and not others.

I am doing a website which will have a pretty typical Contact Us page. It contains an email form
where the sender enters his name, email address and message. The form then reloads the page and a php routine which does some cursory checks, sets up the email and then sends it, using the PHP mail() function.

When testing it, the form successfully sent to two different email addresses, but when I set the
receiving address to the address my client wants, the message never arrives. I do not have any sort of routine to receive delivery error messages, so I cannot tell why it fails. The mail
function consistently indicates the mail was successfully sent.

I have successfully sent to this address using my personal email client (Outlook 2007) so I know the address is valid.

I have included the PHP code and HTML form code in the attached file.

How do I fix this? email-code.txt
Avatar of MISOperations
MISOperations
Flag of United States of America image

Add the address that it is coming from to the exception list in their email, it could be getting blocked.
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gpinzino
gpinzino

ASKER

Thank you both for your immediate responses. I don't know that I can add it to the white list, since the user inserts their email address when sending a message. The email address of the sender will be different every time.

Dave, I will try making the reipient email address the sender address as well and see if it helps.
DaveBaldwin's right, if the messages are going out to some addresses, it's very unlikely to be a problem with the sender.

What I usually do when troubleshooting things like this is do an mx lookup on the problem address, then try telnetting into the server and manually typing SMTP commands to see what happens.
Here's a reference...  
  http://arnab.org/notes/using-telnet-to-send-mail-by-smtp
Bill,
Thanks for your input. If Dave's fix doesn't do it, I will try telnet option.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ray Passeur,
vimalmaria,

Thank you both for your insightful comments. It will be very difficult to decide which suggestions to accept as solutions.

You guys are great!
I think DaveBaldwin's comment at http:#35032033 is right on, too.
Status update.

I am still trying to fix this problem with the email form. I have tried and failed with:
* Setting the sender and recipient to the same address.
* White listing the sender's email address.
* Sending the email to a different box on the same domain.

I am considering PHPMailer, but I am having trouble with the download, and I am not sure I would be able to correctly configure it. The SMTP solution, likewise would probably give me the greatest control over the process, but I feel I would be reinventing the email wheel and I am not simply not up to that task. Of all the skills web developers need, email is probably my weakest.
You should use your own email address as the 'From:' address for a test to see if you even get a bounce or NDR message.  If you do, you can see what the error is.  If you don't, then whatever spam filters they have are simply dropping your emails.  That is not uncommon.
Have you tried the script I posted at http:#35032361 ?  If not, give it a go, and put my public email address as one of the "to" addresses.  Please use Ray.Paseur@Gmail.com so I can see what is getting injected into your mail headers.
Dave, I will give yours a try and see if I get anything.
Ray, likewise, I'll send you a message through the site. Let me know what you see.
Have you sent it yet?  I have seen nothing, even in spam.
Yes, it went out a few minutes ago.
The email came through and did not go to Gmail spam.  The SPF looks good.  A couple of things that might be tripping this up...

The return path and the from address are on different servers.  The X-PHP-Script and X-Antiabuse headers may trigger some spam filters.

A check of this site turned up nothing to be concerned about.
http://www.mxtoolbox.com/SuperTool.aspx?action=blacklist%3a174.120.252.82

The problem with email spam filters is that they are completely unreliable.  Because there is no standard for email, there are as many kinds of "validation" as there are people who think they can outsmart the spammers.  I expect you are running into that kind of situation.  So my advice is to use the same FROM address and REPLY TO address in all the messages you send, and on the form that picks up the client information, put a prominent note asking the client to white-list that address.

HTH, ~Ray
Delivered-To: ray.paseur@gmail.com
Received: by 10.216.157.196 with SMTP id o46cs18294wek;
        Mon, 7 Mar 2011 12:22:08 -0800 (PST)
Received: by 10.150.69.3 with SMTP id r3mr4989488yba.280.1299529327265;
        Mon, 07 Mar 2011 12:22:07 -0800 (PST)
Return-Path: <gdcscom@bracey.site5.com>
Received: from bracey.site5.com (bracey.site5.com [174.120.252.82])
        by mx.google.com with ESMTPS id n12si460187ybk.96.2011.03.07.12.22.06
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 07 Mar 2011 12:22:07 -0800 (PST)
Received-SPF: pass (google.com: best guess record for domain of gdcscom@bracey.site5.com designates 174.120.252.82 as permitted sender) client-ip=174.120.252.82;
Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of gdcscom@bracey.site5.com designates 174.120.252.82 as permitted sender) smtp.mail=gdcscom@bracey.site5.com
Received: from gdcscom by bracey.site5.com with local (Exim 4.69)
	(envelope-from <gdcscom@bracey.site5.com>)
	id 1PwgwQ-0004GG-04
	for Ray.Paseur@Gmail.com; Mon, 07 Mar 2011 14:22:06 -0600
To: Ray.Paseur@Gmail.com
Subject:  An inquiry from Jerry Pinzino
X-PHP-Script: gdcs.com/contact_us.php for 76.217.35.201
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
From: gpinzino@att.net
Message-Id: <E1PwgwQ-0004GG-04@bracey.site5.com>
Date: Mon, 07 Mar 2011 14:22:06 -0600
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - bracey.site5.com
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [2046 32008] / [47 12]
X-AntiAbuse: Sender Address Domain - bracey.site5.com
X-Source: /usr/bin/php
X-Source-Args: /usr/bin/php /home/gdcscom/public_html/contact_us.php 
X-Source-Dir: gdcs.com:/public_html

 Monday, March 7, 2011, 2:22 pm <p>

        Message: Ray,
Here is an email message for you to review. Let me know what you see. By the way, My email routine is pretty close to what you sent me. I did take some of your code and adapt it to what I already had.

Looking forward to hearing from you.

Jerry <p>

        From: Jerry Pinzino <p>

        Email: gpinzino@att.net<p>

		Phone:

Open in new window

I will study your response in detail. Thanks for your help.
Ray, how do you know the return path and the from address are on different servers? I see an IP for the return-path, (bracey.site5.com [174.120.252.82]), but not for the from address (gpinzino@att.net). Am I looking at the wron information?
att.net servers are in the range 216.76.0.0 - 216.79.255.255 which isn't 174.120.252.82.  Isn't 'bracey.site5.com' your web server?  Just as I looked this up, mail servers some times look them up too to see if the email address is a 'valid' one... according to their spam filter.
What DaveBaldwin said!
I'm going to call Charter today and try to get to the bottom of this.
I got it! I finally gave up on the PHP mail() function since the recipient's email service did not like what I was doing. I rewrote the page incorporating PHPMailer as vivalmaria suggested, and it worked on the first try! Thanks also to Ray Passeur for your patience, hands-on assistance and insightful suggestions. Finally, thanks to DaveBaldwin for your insights.

You guys are the best!
Enail is a challenge in the best of circumstances, and the contributions made by the experts all contributed to the insights needed to resolve the issue. Overall, they did a fine job.
Why did you mark our answers down a whole letter grade without even giving us a chance to correct the deficiencies?  What did we do wrong?
Ray,
I am sorry I upset you with my grade. I am fairly new to Experts Exchange and am not familiar with how users grade responses. You tried very hard and stayed with it to the end, and I definitely would have given you an A if the grading were on an individual basis. My impression was that an A was reserved for an effort that provided a complete and successful solution. What I received from some of the others were quick suggestions and not solutions in themselves. You were the only one that offered code as a possible solution. I got the impression that most of the others did not even look at my code. You, and to a lesser extent, DaveBaldwin, were the only two that hung in there and continued to offer assistance. I gave you additional points for your obvious conern and persistance in trying to provided a solution. In retrospect, I should have raised your points even more. Now that I understand what an important issue the grade is, I will be more generous next time.
Thanks, gpinzino.  

You may find over time that some answers at EE are tested solutions and some are just educated guesses.  You will also learn who provides what!  

DaveBaldwin, BPortlock, Roads Roads, hielo, angelIII, jason1178 all seem pretty heads-up to me.  Not to take anything away from the others who toil in this forum, but those guys are some of the ones who seem to provide the most insight and understanding.

All the best, ~Ray
Thanks Ray, but you are seriously more organized than I am.!
Well, you are both great guys in my book! Thanks for being active participants in such a great service.
You're welcome, glad to help.