Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sending mail using php gmail swiftmailer = error -> where is the problem?
- function SendCookieToTheMail()
- {
- require_once 'swift-mailer/lib/swift_required.php';
- //Create the Transport
- $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com')
- ->setPort(465)
- ->setEncryption('ssl')
- ->setUsername('007@gmail.com')
- ->setPassword('123')
- ;
- //Create the Mailer using your created Transport
- $mailer = Swift_Mailer::newInstance($transport);
- //Create a message
- $message = Swift_Message::newInstance('Test')
- ->setFrom(array('007@gmail.com' => 'From mr. 007'))
- ->setTo(array('007@gmail.com', '007@gmail.com' => 'To mr. 007'))
- ->setBody('Body')
- ;
- //Send the message
- $result = $mailer->send($message);
- /*
- You can alternatively use batchSend() to send the message
- $result = $mailer->batchSend($message);
- */
- }
- phpinfo();
- ;extension=php_openssl.dll
Add Comment
Please, Sign In to add comment