Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

Email failure

Hello,

I have been struggling with this for quite a while; some of my previous questions have dealt with parts of this.

See attached updt_testt.php. Note the use of class.phpmailer.php on line 57 (also attached). Note lines 65 - 66, as follows:

$eaddr3 = "kneff@lawnsprinklerservices.com";
$mail->AddAddress($eaddr3);

Note the other email addresses (specifically aveatch@lawnsprinklerservices.com and richardkorts@gmail.com). When this is run on the server, emails are sent to all EXCEPT kneff@lawnsprinklerservices.com.

See attached thank_you.php. Note the use of class.phpmailer.php on line 51 (also attached). Note lines 58 - 59 as follows:

$addr3 = "kneff@lawnsprinklerservices.com";
$mail->AddAddress($addr3);

When this one is run, emails are received by all.

Why does it work with one & not the other for one specific email address?

Thanks
updt-testt.php
thank-you.php
class.phpmailer.php
0
Richard Korts
Asked:
Richard Korts
  • 12
  • 9
  • 6
2 Solutions
 
xtermCommented:
What operating system is the server running?
0
 
Richard KortsAuthor Commented:
To xterm,

I'm not sure, it's a commercial web server, I'm assuming Linux.

Thanks
0
 
Dave BaldwinFixer of ProblemsCommented:
Are you getting a NDR / bounce message?  Which web site are you sending the email from?  And lastly, what message rules and spam filtering are setup on the email client for "kneff@lawnsprinklerservices.com"?  If they have a rule or spam filter that id's your email or server as spam, you won't be able to get thru.  I know that SpamAssassin grey-listing will block the Godaddy mail servers.  I had to turn that off in my email setup on my web site.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
xtermCommented:
If it's Linux, then you should be able to look at /var/log/maillog at the time you submit the web form, and you will see what happens with the attempt.

You can run the command "tail -f /var/log/maillog" and it will show you the last few lines, and continue to scroll when anything new gets added to it.  Hit CTRL-C to cancel out of it.  This should tell you if it's even attempting the mail, and any errors it encounters.

You can also use the command "mailq" which will tell you which mails are stuck in queue waiting to go out.  If your messages are in there, you will see the error that caused the failure in the output of the mailq command.
0
 
Richard KortsAuthor Commented:
DaveBaldwin,

The message is just not received by the indicated email address.

It is sent on lawnsprinklerservices.biz.

Until a few days ago, the "anti-spam" was turned on for the address failing, it was NOT turned on for Aveatch@lawnsprinklerservices.com & his are (were) coming through. So, of course, I thought it was that.

I changed that to turn anti-spam off; same result. I did a test this AM AFTER I made the change & it failed.
0
 
xtermCommented:
The mail exchanger servers for lawnsprinklerservices.com|biz are mx00.1and1.com and mx01.1and1.com.  You should be able to ask your host to look at their mail system logs to determine if the mail was received, rejected, or quarantined.

I still think you should check on your web server first to see if the messages are going out though first, since that is the natural order of diagnostics.
0
 
Richard KortsAuthor Commented:
xterm

I don't think we are communicating.

The mail is sent, the mail class reports it as so & it IS RECEIVED by at least two of the recipients.

The issue is it is NOT being received by ONE of the recipients, and only in ONE case, not the other which is programmed identically.
0
 
Dave BaldwinFixer of ProblemsCommented:
Those files are not nearly the same.  The 'thank-you.php' is for WHA, not lawnsprinklerservices.biz.
0
 
Richard KortsAuthor Commented:
DaveBaldwin

Sorry, I sent the wrong one. See attached.

Thanks
thank-you.php
0
 
Dave BaldwinFixer of ProblemsCommented:
That one has the "donotreply@LSS.com" 'From:' address.  Is that the one with the problem?
0
 
Richard KortsAuthor Commented:
I just looked at the code. From what I see lines 54 - 64 look like this. But this is the one that WORKS.

      $mail             = new PHPMailer();
      $addr1 = "lawnsprinklerservice@hotmail.com";
      $mail->AddAddress($addr1);
      $addr2 = "aveatch@lawnsprinklerservices.com";
      $mail->AddAddress($addr2);
      $addr3 = "kneff@lawnsprinklerservices.com";
      $mail->AddAddress($addr3);
      $cc = "richardkorts@gmail.com";
      $mail->AddCC($cc);
      $mail->Subject = "On-Line Invoice Payment";
      $mail->SetFrom('service@lawnsprinklerservices.com');
0
 
xtermCommented:
I don't think we are communicating.

The mail is sent, the mail class reports it as so & it IS RECEIVED by at least two of the recipients.

The issue is it is NOT being received by ONE of the recipients, and only in ONE case, not the other which is programmed identically.


I understand you perfectly  - I'm telling you (as an ISP system administrator of a very large mail system) how to determine whether the email is leaving your web server or not, and/or if after it's left, it's been received by the remote server.  The fact that 2 out of 3 recipients actually gets their copy of the mail indicates to me that there is no reason to suspect your code, but instead the SMTP process after your form is submitted.

I'm not understanding your hesitation to run a few simple commands - do you not have Unix access to your web server?
0
 
Dave BaldwinFixer of ProblemsCommented:
Richard, there are two more sections in that code that use the PHP mail() command.  Can you send any email with any client to the address that is failing?

@xterm, I think it's likely that he is on shared hosting with the mx00.1and1.com mail server.
0
 
Richard KortsAuthor Commented:
To xterm, what Dave Baldwin says is exactly right. It is 1 & 1 shared host. I might be able to get to those logs, I can't remember how well 1 & 1 cooperates on that kind of request; usually, not too well.

Dave, I can manually send her an email using my gmail.

The php program thank_you.php sends emails to the company admin (she is one) when a customer pays an invoice online. She gets those. I had forgotten that there was a 2nd email sent (in thank_you) to the customer; since it works, I did not change it, although I am gradually changing ALL my email generations to class.phpmailer.php; I believe that was partially or exclusively your recommendation a while back.

The ONLY ones she does not get (of the automated ones) is the one sent upon the entry of a new customer (uptd_testt.php). I am trying to determine what is different about the email sending part between thank_you (works) and uptd_testt.php (does NOT work, but ONLY for that ONE email address).

Thanks
0
 
xtermCommented:
Well, it's a lot harder to troubleshoot without simply looking at what happened on the server, but since you say that is difficult to obtain, let's analyze it from a code standpoint:

1)  thank_you.php
- Uses the PHP built-in mail() functionality to send
- Sets a From address of WHA@whasocal.org
- Works as it should

2) uptd_testt.php
- Uses class.phpmailer to send
- Sets a From address of service@lawnsprinklerservices.com
- Works as it should for 2 out of 3 recipients

The question I guess is, if you substitute the To: address from uptd_testt.php that isn't receiving the mail (kneff@lawnsprinklerservices.com) into thank_you.php, does it get the email?

So change $tostr = "richard@rkassociates.com"; temporarily to "$tostr = "kneff@lawnsprinklerservices.com"; and then submit the form and see if the message is received.

Is that doable?
0
 
Richard KortsAuthor Commented:
To xterm

The version of thank_you.php originally attached to this question was the WRONG one; the correct one is attached.

The emails are ALL properly sent from thank_you.php. It is the other one (updt_testt.php) that delivers all EXCEPT to kneff@lawnsprinklerservices.com.

Thanks
thank-you.php
0
 
xtermCommented:
Gotcha, looking it over.
0
 
xtermCommented:
Since you don't have access to the mail system logs, the best I can suggest to you is in updt_testt.php, shuffle the recipient order around to see if that changes who gets the emails.

So maybe replace:
         
                $eaddr1 = "lawnsprinklerservice@hotmail.com";
                $mail->AddAddress($eaddr1);
                $eaddr2 = "aveatch@lawnsprinklerservices.com";
                $mail->AddAddress($eaddr2);
                $eaddr3 = "kneff@lawnsprinklerservices.com";
                $mail->AddAddress($eaddr3);

Open in new window

with:
               
                $eaddr0 = "kneff@lawnsprinklerservices.com";
                $mail->AddAddress($eaddr0);
                $eaddr1 = "lawnsprinklerservice@hotmail.com";
                $mail->AddAddress($eaddr1);
                $eaddr2 = "aveatch@lawnsprinklerservices.com";
                $mail->AddAddress($eaddr2);

Open in new window

And resubmit, and see which recipients receive it.
0
 
Richard KortsAuthor Commented:
xterm,

Thanks, I tried that & the result is the same (same people get delivery, the one that hasn't all along does not get it reshuffled either.

Thanks

Any other ideas? Anyone?

I know if I change hosts I can make it work (this ISN'T Rocket Science) but my client has already advance paid for hosting so he doesn't want to change.
0
 
Dave BaldwinFixer of ProblemsCommented:
I know if I change hosts I can make it work
How do you know that?  While you're right that it isn't Rocket Science, email is a Mess still.  Many things are not predictable because you can't see what is blocking your email from going thru.  You can not Force someone to receive an email from you.
0
 
Richard KortsAuthor Commented:
DaveBaldwin

Alright, I don't KNOW that. But I STRONGLY suspect it.

Do you think it could be a timing thing?

Like if I pause 10 seconds BEFORE sending the email that does NOT go through, then send it by itself?

Thanks
0
 
xtermCommented:
I think at this point you need to break down and ask your host to check outbound mail logs and/or mail queues on the web server sending the mail - this is something simple, and all you lack to solve it is visibility.
0
 
Richard KortsAuthor Commented:
to xterm

I will try that; based on my past experience with them, that will be difficult.

Thanks
0
 
xtermCommented:
While you're waiting for an answer on that, just for grins can you do the following change and see if anything different happens?

After these lines:

                echo "body = " . $body . "<br>";
                $mail->MsgHTML($body);

Add this one:

                mail("$eaddr3", "New Instant Customer - test 7","$body","From: service@lawnsprinklerservices.com\r\n","-f"."service@lawnsprinklerservices.com");

And see if it goes through - basically it bypasses the phpmailer class and just does a manual send with all of the same info as the other one.
0
 
Richard KortsAuthor Commented:
To all,

I may have a clue. The customer told me that the email lawnsprinklerservice@hotmail.com forwards to kneff@lawnsprinklerservices.com.

So why we have to send to both is ???

So it MIGHT be that 1 & 1 is set up to reject what appears to be two identical emails in a VERY short period of time; sort of a start of an onslaught. Easy to test, I will.

Thanks
0
 
Dave BaldwinFixer of ProblemsCommented:
Well, I consider 1and1 to be a bad host.  But every sign so far is that either 1. the recipient is blocking the email or 2. you're getting bad info from the client.  According to your comment above, kneff@lawnsprinklerservices.com should be getting two emails each time.
0
 
Richard KortsAuthor Commented:
The problem is NOT solved; I am splitting the points based on the effort you both put it.

My customer said (basically) "stop wasting time on that, we will just forward her (kneff@lawnsprinklerservices.com) the one I get".

Rkorts
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 12
  • 9
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now