I've got a mail script that I've been trying to get working properly.
Thanks to help from the forums here, I have all the proper includes now.
I have several print outs in the code to be sure it gets to certain points, and the die statements don't show anything so I'm pretty certain it is completing.
The recipient in the TO line isn't receiving it, however.
The server I'm working on hasn't been configured by the company but they say that SMTP should route from it properly within their domain (the server is in their network and the email goes to an email address within their network).
There are a lot of configuration issues I'm probably not aware of so I know I'm asking a lot here but I feel it's worth a shot to see what advice might help out.
The server is a Win2k3 box running Apache & PHP with PEAR.
IIS with SMTP is installed but questionably configured, though I don't even know if I need SMTP installed to use it with PEAR.
For the sake of code:
Code:
require_once "Mail.php";
$headers["From"]=$email;
$headers["To"]="recipient@domain.com";
$headers["Subject"]=$subject;
$recipients="recipient@domain.com";
$mailmsg=$question;
//Setup SMTP Infomation
$smtpinfo["host"] = "smtp.domain.com";
$smtpinfo["port"] = 25;
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "username";
$smtpinfo["password"] = "password";
//Create Mail Object
$mail_object =& Mail::factory('smtp', $smtpinfo) or die("Error: " . PEAR_Error::getMessage());
//Send Mail Object
$mail_object->send($recipients, $headers, $mailmsg) or die("Error: " . PEAR_Error::getMessage());
The domain specific information has been edited out, of course.
Also to be noted, I don't even know if they require authorization with a username and password as the IT department has been very unhelpful to this point.