Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Automated Email Issues

Posted on 2014-11-25
6
Medium Priority
?
100 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
In this video we show how to create an email address policy 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 Mail Flow…
Suggested Courses

730 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