Hi,
Based on the code included, you are not specifying the transport to use.
This means that Zend_Mail is using the default which is Sendmail. To
change the default behaviour, try this:
|http://framework.zend.com/manual/en/zend.mail.sending.html|
|
require_once 'Zend/Mail/Transport/Smtp.php';
$tr = new Zend_Mail_Transport_Smtp('mail.example.com');
Zend_Mail::setDefaultTransport($tr);
|
Hope that helps.
Luke
Jerry McG wrote:
Hi All,
I am attempting to use Zend_Mail via the default
Zend_Mail_Transport_Sendmail transport on my local Windows machine. But for
some reason I am getting error "Fatal error: Uncaught exception
'Zend_Mail_Transport_Exception' with message 'Unable to send mail' in
D:\Path\library\Zend\Mail\Transport\Sendmail.php."
Should I change any configuration info in php.ini file before I use
Zend_Mail? At present my php.ini has the below:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = [EMAIL PROTECTED]
I am attempting the following code:
require_once 'Zend/Mail.php';
$mail = new Zend_Mail();
$mail->setBodyText('This is the text of the mail.');
$mail->setFrom('[EMAIL PROTECTED]', 'Some Sender');
$mail->addTo('[EMAIL PROTECTED]', 'Some Recipient');
$mail->setSubject('TestSubject');
$mail->send();
Thanks!
Jerry