Skip to content

Instantly share code, notes, and snippets.

@dantoncancella
Last active September 27, 2020 08:42
Show Gist options
  • Save dantoncancella/4564395 to your computer and use it in GitHub Desktop.
Save dantoncancella/4564395 to your computer and use it in GitHub Desktop.
Configure Gmail SMTP with Zend Framework
<?php
$config = array(
'ssl' => 'tls',
'port' => 587,
'auth' => 'login',
'username' => 'myusername@mydomain.com',
'password' => 'myPassword'
);
$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
$mail = new Zend_Mail();
$mail
->setFrom('myusername@mydomain.com', 'From')
->setSubject('Subject')
->addTo('youremail@yourdomain.com')
->send($transport);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment