Problem With Phpmailer

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("recipient Email"); // recipient Email
$mail->setFrom("Sender Email"); // Sender Email
$mail->Subject="title";
$mail->Body="hello world !";
$mail->isSMTP();
$mail->Host="mail.mehregan-software.ir"; // SMTP Host
$mail->Username="Sender Email";   //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.';
   }
?>

this is my host and smtp information

Is that outgoing server setting correct for SSL mail? It seems that you’re using the outgoing server from the non-SSL setting, but the port for SSL.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.