I'm trying to send email using the Swiftmailer
.
I'm getting an Uncaught Error:
Call to undefined method Swift_SmtpTransport::newInstance().
Here is the code:
require_once 'swift/lib/swift_required.php';
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
->setUsername ('email@gmail.com')
->setPassword ('password');
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Weekly Hours')
->setFrom (array('email@gmail.com' => 'My Name'))
->setTo (array('email@hotmail.com' => 'Recipient'))
->setSubject ('Weekly Hours')
->setBody ('Test Message', 'text/html');
$result = $mailer->send($message);
Based on the above code, what would be causing that mistake?