Mailjet and Zend code sample

integration with Zend's Email library

1) Use

 
<?php
 
 $config = array('ssl' => 'ssl',
                    'port' => 465,
		    'auth' => 'login',
		    'username' => 'your_Mailjet_API_Key',
		    'password' => 'your_Mailjet_Secret_Key');
 
    $transport = new Zend_Mail_Transport_Smtp('in.mailjet.com', $config);
 
    $mail = new Zend_Mail();
 
    $mail->setFrom('your_sender@address.com', 'You');
    $mail->addTo('recipient@example.com', 'Anybody');
    $mail->setSubject('My first email by Mailjet');
    $mail->setBodyText('Hello from Mailjet & Zend Framework !');
 
    $mail->send($transport);
 
?>
 

You have to edit the $config array as below :

- 'smtp_host' : ssl://in.mailjet.com if you want use SSL secure mode, tls://in.mailjet.com for TLS secure mode or in.mailjet.com for no encryption.
- 'smtp_port' : the port used to transport your emails (465, 587, 588, 25)
- 'smtp_user' : it's your API Key
- 'smtp_pass' : it's your Secret Key.

Do not forget to edit your sender address "from".

2) More

http://framework.zend.com