PEAR Mail/smtp sending problem
| From: | Christopher J. Mackie | Date: | Sun, 30 May 2004 18:34:06 +0000 |
| Subject: | PEAR Mail/smtp sending problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-187241@lists.php.net to get a copy of this message | ||
I'm following the PEAR docs to use Mail/SMTP. Below is the code I use,
swiped directly from the docs--I've changed the authorization data to
protect privacy, but otherwise it's identical (and email sent from a client
on this same machine using the same settings works fine). I'm running PHP
4.3.6 ISAPI on Win2k3 Server, IIS6.0.
No errors are generated back to me, but the messages aren't going through.
I can't see the smtp server logs, so I don't know what's failing.
I'm new to PHP: what am I missing? Is there a way that I can examine on my
end the errors that are presumably being generated at the SMTP server?
Tx, --CJ
<?php
include('Mail.php');
$recipients = 'joe@example.com';
$headers['From'] = 'cjm@princeton.edu';
$headers['To'] = 'joe@example.com';
$headers['Subject'] = 'Test message';
$body = 'Test message';
$params['host'] = 'smtpserver.princeton.edu';
$params['auth'] = TRUE;
$params['username'] = 'cjm';
$params['password'] = 'mypass';
$params['port'] = '25';
$mail_object =& Mail::factory('smtp', $params);
$mail_object->send($recipients, $headers, $body);
?>