Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

Automated Email Issues

I am having a problem with sending email with attachments in a php environment.

See attached. The php script called php_mail_wattach.php, I have used for some time with both the customer now having issues and for other clients. I found it on the web over a year ago.

The attached script called email_test.php is a script I built today specifically to try to solve the general issue.

The issue is that for any email address like xyz@fwsprinkler.com, any emails sent this way fail. But I can "manually" send an email with the same attachment to the same address & it gets received.

Also, if I send an email using this technique to myself (at a gmail address) & others, they receive it.

Until about 10 days ago, xyz@fwsprinkler.com DID receive emails sent like this. The site is hosted at GoDaddy.

How can I determine what is causing the problem?

Thanks.
php-mail-wattach.php
email-test.php
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

I'm surprised that it ever worked at all.  This may be an EE problem but the file name "php_mail_wattach.php" is not what you posted which is "php-mail-wattach.php" .  

The other part is that you have no 'body' to your message.  Mail servers and programs can detect that.  The end of the headers is supposed to be a single blank line.  Much of what you put in the 'header' belongs in the body.  Basically, you email is not formatted properly and that is probably why is is not being received.  Here is a decent article on the subject.  http://www.sitepoint.com/advanced-email-php/

Send yourself an email with that attachment with a 'regular' email client and with your code.  Then look at the source for both.  I think the difference will be immediately apparent.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
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 Richard Korts

ASKER

Dave Baldwin,

For whatever reason, EE changes _ to - in file names.

That has happened before.
To Ray Paseur,

Thanks for those references. I am trying to use sendgrid; it is VERY difficult to get them to "provision" my account, I'm struggling with that now.

I also looked at the others, I could not figure out how to download the package from GitHub, I have not used GitHub much before, so I am sure it's just my lack of knowledge of their terminology.

Constant Contact is fine but I'm trying to send email from a web site, these are limited messages just to the employees of the company, this is not a big marketing campaign.

It is frustrating to me there is not an easy solution.
I got sendgrid to work.

Thanks!
I've just finished an integration with SendGrid.  It was relatively smooth; glad you got similar results! ~Ray