im new to heroku,and im trying to send email using php in heroku,but its wont send any email,the php works fine,but mailing not working,i searched about it and find out,its work only with a add-ons ,plugins and kind of that,i tried PHPmailer library,and tried this code it was example mentioned by phpmailer
<?php
$mail = new PHPMailer(false); // Passing true enables exceptions
//Server settings
//$mail->SMTPDebug = 1;//Enable verbose debug output
$mail->isSMTP();//Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com';//Specify main and backup SMTP servers
$mail->SMTPAuth = true;//Enable SMTP authentication
$mail->Username = 'example@gmail.com';//SMTP username
$mail->Password = 'mypassword';//SMTP password
$mail->SMTPSecure = 'tls';//Enable TLS encryption, `ssl` also accepted
$mail->Port = 465;//TCP port to connect to
//Recipients
$mail->setFrom('example@gmail.com','myapp');
$mail->addAddress('example@gmail.com');//Add a recipient
//$mail->addAddress('example@gmail.com');//Name is optional
$mail->addReplyTo('example@gmail.com','Contact');
//Content
$mail->isHTML(true);//Set email format to HTML
$mail->Subject = 'test';
$mail->Body = 'this is a test';
$mail->send();
?>
im beginner,please help me to make it work with heroku :(i know how to do it in PHP,and thats work fine,but in heroku,not working,seems its need plugin... explain step by step,thanks for answers in advance @>