I am trying to send an email with a gmail account under Zend. This is what I got so far:
$mailTransport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', array( 'auth' => 'login', 'username' => ' myaddress@gmail.com ', 'password' => 'password', 'port' => '587', 'ssl' => 'tls', )); Zend_Mail::setDefaultTransport($mailTransport); $mail = new Zend_Mail(); $mail->setBodyText('This is the text of the mail.'); $mail->setFrom(' myaddress@gmail.com ', 'sender'); $mail->addTo(' reciever@gmail.com ', 'receiver'); $mail->setSubject('TestSubject'); $mail->send();
Using this code, I get the following error:
Message: Unable to connect via TLS
How can i fix this? I have installed the default installation of XAMPP without configuring SMTP in php.ini.
source share