hi every one am new in sending mail via php i've tried sending with php function mail() but seem like its no more working now i've tried to send via swift mailer and its not giving too can someone please help me i've tried to follow some tutorials i've found on the web but the result is stil the same this is my code
require_once 'vendor/autoload.php';
$subject="Testing Mail";
$body="<h2>This is the body</h2>";
$to="abouleromaric@gmail.com"; //this is the to email address
// require_once 'swiftmailer/swift_required.php';
// Create the mail transport configuration
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')->setUsername('abou')->setPassword('abou');
//$transport = Swift_MailTransport::newInstance();
$message = Swift_Message::newInstance()
->setSubject($subject)
->setFrom(array('aboulegbayanga@gmail.com'))
->setTo(array($to))
->setBody($body,'text/html');
//send the message
$mailer = Swift_Mailer::newInstance($transport);
$result=$mailer->send($message);
the result i get from it is
Fatal error: Uncaught Error: Call to undefined method Swift_SmtpTransport::newInstance() in C:\xampp\htdocs\maili\index.php:12 Stack trace: #0 {main} thrown in C:\xampp\htdocs\maili\index.php on line 12