I'm using Slim PHP framework and trying to send e-mail via Gmail. The problem is when I am sending the e-mail, it will cause "Slim Application Error."
$mailer->send($message);
Here is my function to send the e-mail
function send_email($email)
{
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 587,'tls')
->setUsername('pandala61@gmail.com')
->setPassword('yourpassword');
$mailer = Swift_Mailer::newInstance($transport);
// Create a message
$message = Swift_Message::newInstance('Test mail')
->setFrom(array('from_email@gmail.com' => 'SENDER'))
->setTo(array('To_email@gmail.com'))
->setBody("Hello, test send mail");
// Send the message
$mailer->send($message);
}