---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/sendgrid/for-developers/sending-email/zend#article
headline: Send email with Zend and Twilio SendGrid
description: Learn how to send email with the Zend Framework mail module and Twilio SendGrid by configuring Zend's SMTP transport to use Twilio SendGrid's SMTP servers.
url: https://www.twilio.com/docs/sendgrid/for-developers/sending-email/zend
inLanguage: en
dateModified: 2026-07-23T16:57:51.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# Send email with Zend and Twilio SendGrid

To send outgoing messages through the Twilio SendGrid Simple Mail Transfer Protocol (SMTP) servers, integrate the Zend Framework mail module with Twilio SendGrid.

```php {title="Send email with Zend over Twilio SendGrid SMTP"}
<?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 = 'username';
$api_key = 'api_key';

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

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

$mail = new Zend_Mail();

$mail->setFrom('sendeexampexample@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);
?>
```

If you prefer a modular installation, then [check out Jurian Sluiman's SlmMail project at GitHub](https://github.com/juriansluiman/SlmMail.git).
