Sending mail with swiftmailer but the page goes blank without any message

I am sending mail using swiftmailer, but no message is sent to receive and the page goes blank without any message. I am using gmail smtp. nothing changed in my php.ini file. my php.ini file needs any change. openssl.dll aleady unblock.please help me. this is urgent. If I want to use ip instead of smtp.gmail.com, this is where I change. here is my code

<?php
require_once 'lib/swift_required.php';
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com',465,'ssl');
$transport-> setUsername('my@gmail.com');
$transport-> setPassword('*******');
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance();
$message->setSubject($subject);
$message->setFrom(array($headers=>$myname));
$message->setTo($value);
$message->setBody($mail_body, 'text/plain');
$result = $mailer->send($message);
?>

      

+3


source to share





All Articles