LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   PHP Mail and Faxing (http://www.linuxquestions.org/questions/linux-general-1/php-mail-and-faxing-4175450160/)

CincinnatiKid 02-14-2013 02:00 PM

PHP Mail and Faxing
 
I am signed up with a faxing company (www.efaxcorporate.com). They allow you to send a fax by email. For example, from the email account associated with my efaxcorporate account, I can send an email that goes to a fax machine by sending the email to [faxnumber]@eFaxsend.com. I use this function all the time and it works.

I want to be able to do this from PHP instead of just from a mail client, so I tried this:

Code:

mail ("faxnumber@eFaxsend.com", "My Subject", "Hello World.", "From: myemailaddress@mydomain.com");
This does not work, the fax does not get delivered. I also tried using SMTP Authentication in the PHP code, and that didn't work either. obviously the fax company detects that this is not a "true" email, what is different about using PHP mail and using a mail client, or a web mail client?

Can you think of any way I can make this work?

j-ray 02-15-2013 02:59 AM

If the email "From" address contains a different domain than the mail server your email will very likely be regarded as spam. Send yourself an email from the script and take a look at the email headers.

scheidel21 02-15-2013 09:04 AM

j-ray has a point, but you can often also add additional allowed hosts in many services. In addition to this if you have an SPF record you should add the server it's coming from to the record.

CincinnatiKid 02-15-2013 10:53 AM

It is actually the same domain, it is where my email is hosted. I checked the headers and the domain is the same.

scheidel21 02-15-2013 10:04 PM

Can you send yourself an email and look for any differences? Plus can you contact tech support for the fax service and see if their logs are receiving/processing the php emails?

CincinnatiKid 02-21-2013 03:25 PM

FYI, I figured out the issue, I used a fifth parameter for mail(), see below:

Code:

mail ("faxnumber@eFaxsend.com", "My Subject", "Hello World.", "From: myemailaddress@mydomain.com", "-f myemailaddress@mydomain.com");
With this fifth parameter, the message is no longer being flagged as spam, thanks for the ideas people.


All times are GMT -5. The time now is 05:34 PM.