I'm currently working on an app with Zend Framework 3 hosted in OVH. I'm trying to send mail with Zend_Mail but without success... so here is my code :
$message = new Message();
$message->addTo('client_name@gmail.com')
->addFrom('email_account@host.com')
->setSubject('Test subject!')
->setBody("Test Body!");
// Setup SMTP transport using LOGIN authentication
$transport = new SmtpTransport();
$options = new SmtpOptions();
$transport->setOptions($options);
$transport->send($message);
And In my SmtpOptions.php file :
protected $name = 'OVH';
/**
* @var string
*/
protected $connectionClass = 'smtp';
/**
* Connection configuration (passed to the underlying Protocol class)
*
* @var array
*/
protected $connectionConfig = [
'ssl' => 'ssl',
'auth' => 'login',
'username' => 'my_username',
'password' => 'my_pass'
];
/**
* @var string Remote SMTP hostname or IP
*/
protected $host = 'ssl0.ovh.net';
/**
* @var int
*/
protected $port = 465;
I've got an 5.7.1: access denied error and i can't figure out why ? Any help would be appreciate ! :) Let me know if it's not clear or if you need other informations.