Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

43 lines (33 sloc) 1.19 kb
layout weight title seo navigation
page
0
Zend
title description
Send Email with Zend & SendGrid
View instructions on how to easily send email with Zend using SendGrid, by setting up setting up Zen's mail module.
show
true

You can directly integrate Zend's mail module with SendGrid to use our SMTP servers for outgoing messages.

{% codeblock lang:php %} <?php require_once '$HOME/sendgrid/Zend/library/Zend/Mail.php'; require_once '/$HOME/sendgrid/Zend/library/Zend/Mail/Transport/Smtp.php';

$smtpServer = 'smtp.sendgrid.net'; $username = $password =

$config = array('ssl' => 'tls', 'port' => '587', 'auth' => 'login', 'username' => $username, 'password' => $password);

$transport = new Zend_Mail_Transport_Smtp($smtpServer, $config);

$mail = new Zend_Mail();

$mail->setFrom('sender@example.com', 'Some Sender'); $mail->addTo('email@example.com','Some Recipient'); $mail->setSubject('Test Subject'); $mail->setBodyText('This is the text of the mail using Zend.');

$mail->send($transport); ?> {% endcodeblock %}

If you prefer a modular installation, then check out Jurian Sluiman's SlmMail project at GitHub.

Jump to Line
Something went wrong with that request. Please try again.