Solved

Automated Email Issues

Posted on 2014-11-25
6
86 Views
Last Modified: 2014-11-26
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
0
Comment
Question by:Richard Korts
  • 3
  • 2
6 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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.
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
The PHP mail() command is associated with all kinds of repellent spam, especially when the messages originate from GoDaddy.  Spam filters know about that.  I would avoid that path and try one of the packages.  I have used all of these with good success:
https://sendgrid.com/docs/Integrate/index.html
https://github.com/PHPMailer/PHPMailer
http://www.constantcontact.com/index.jsp
0
 

Author Comment

by:Richard Korts
Comment Utility
Dave Baldwin,

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

That has happened before.
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

Author Comment

by:Richard Korts
Comment Utility
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.
0
 

Author Closing Comment

by:Richard Korts
Comment Utility
I got sendgrid to work.

Thanks!
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
I've just finished an integration with SendGrid.  It was relatively smooth; glad you got similar results! ~Ray
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

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

11 Experts available now in Live!

Get 1:1 Help Now