I've got a site that requires people to register and we send a confirmation email. When I use mail() to send these confirmation emails, they aren't getting through to certain addresses despite my best efforts at setting header info.
I think I know what the problem is. The emails appear to be from a separate domain than my 'from' address--even if I use the -f flag for sendmail as I did here:
mail('myemail@hotmail.com', 'testing mail with params', 'here goes tha message message', null, '-fadmin@mydomain.com')
or die('mail didnt send');
Received: from myserver.myisp.com ([222.222.222.222]) by bay0-mc7-f2.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444); Fri, 21 Jul 2006 17:18:25 -0700
Received: by myserver.myisp.com (Postfix, from userid 33)id 7FA5B22A003; Fri, 21 Jul 2006 19:21:15 -0500 (CDT)
X-Message-Info: txF87lGdW43hVUaBMdEAtfIcT/Hw3meBjXoQ+RfhFdk=
Return-Path: admin@mydomain.com
X-OriginalArrivalTime: 22 Jul 2006 00:18:25.0449 (UTC) FILETIME=[5940E190:01C6AD24]
EDIT: I want mails to appear to be from mydomain.com, NOT myserver.myisp.com
I believe my solution to set up this particular project to send all mail through a mail server using some kind of library to connect such as:
Pear mail:
http://pear.php.net/package/Mail
or xpert mailer:
http://www.xpertmailer.com//?free=smtp_mail&func
HOWEVER, I am fairly certain my employer will want their resulting code to be distributable...meaning free of any license restrictions against redistribution for profit.
The Pear module says that it is 'PHP/BSD' license without providing any detail. I'm not lawyer but having googled around for BSD license:
http://en.wikipedia.org/wiki/Bsd_license
It would appear that I might use the PEAR module in a proprietary project that I could distribute and license.
So, two questions:
1) will using the PEAR mail project help me solve the problem i'm having with emails - namely that the RECEIVED header information doesn't match my domain
2) If I use the PEAR mail module in my project , will my project still be distributable as proprietary software that we can require licenses to use, hopefully thereby making profits?