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

x
?
Solved

Automated Email Issues

Posted on 2014-11-25
6
Medium Priority
?
104 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 84

Expert Comment

by:Dave Baldwin
ID: 40466265
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 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 40466597
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
ID: 40466871
Dave Baldwin,

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

That has happened before.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Richard Korts
ID: 40467298
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
ID: 40467372
I got sendgrid to work.

Thanks!
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 40467948
I've just finished an integration with SendGrid.  It was relatively smooth; glad you got similar results! ~Ray
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

The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

916 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