I want to send mail with phpmailer from my host,but when i run this code,any message show in result. what is my problem in this code?
<?php
require_once("PHPMailer-master/class.phpmailer.php");
$mail = new PHPMailer();
$mail->addAddress("mehregan.programmer@gmail.com"); // recipient Email
$mail->setFrom("info@mehregan-software.ir"); // Sender Email
$mail->Subject="title";
$mail->Body="hello world !";
$mail->isSMTP();
$mail->Host="mail.mehregan-software.ir"; // SMTP Host
$mail->Username="info@mehregan-software.ir"; //I created this mail in my host
$mail->Password="*****"; // password for email
$mail->SMTPSecure="ssl";
$mail->Port=465;
$mail->SMTPAuth = true;
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
exit;
} else {
echo 'Message has been sent.';
}
?>
here is my host and smtp information
enter image description here