$port); if (variable_get('zend_mail_smtp_encryption', 'none') != 'none') { $config['ssl'] = variable_get('zend_mail_smtp_encryption', 'none'); } $transport = new Zend_Mail_Transport_Smtp($host, $config); $transport->connect(); } $mail = new Zend_Mail(); foreach ($message['headers'] as $header => $value) { if ($header != 'Return-Path' && $header != 'From') { $mail->addHeader($header, $value); } } $mail->setBodyText($message['body']); $mail->setFrom($message['from']); $mail->addTo($message['to']); $mail->setSubject($message['subject']); try { @$mail->send($transport); } catch (Zend_Mail_Transport_Exception $ex) { // Do nothing. } if ($transport) { $transport->disconnect(); } return TRUE; } return FALSE; }