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
Solved

Automated Email Issues

Posted on 2014-11-25
6
91 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 83

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 109

Accepted Solution

by:
Ray Paseur earned 500 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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 109

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
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…
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…

840 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