Sending emails with Zend_Mail

If you are trying to send emails with Zend_Mail, we recommend that you do it in a way so that Zend_Mail uses the mail() function (instead of delivering the message over SMTP).
To do this, just setup Zend_Mail and send the message without specifying a transport. Here is an example:

require_once ‘Zend/Mail.php’;
$mail = new Zend_Mail();
$mail->setBodyText(‘This is the text of the mail.’);
$mail->setFrom(‘’, ‘ServerGrove’);
$mail->addTo(‘’, ‘Your name’);
$mail->setSubject(‘Zend Framework Test’);
print “ok”;