I have code to send message via php mailer to my email address.
I get server error but i don't receive any message on inbox or spam folder.
Please help and , and this is my code
<?php
require_once("class.phpmailer.php");
include("class.smtp.php");
try {
$sname= "moda"; //
$smail="nase25r@yahoo.com"; // sender email
$rname="anyone"; //
$rmail="nalshlwan@kacst.edu.sa"; // receiver email
$sub="supject";
$body="ggggggggggggggggggggggggggggggggggggggggggggggggggg";
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "TLS";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = ""; // my gmil email
$mail->Password = ""; // my gmail password
$mail->AddReplyTo($smail,$sname);
$mail->AddAddress($rmail, $rname);
$mail->From = $smail;
$mail->FromName = $sname;
$mail->Subject = $sub;
$mail->MsgHTML($body);
$mail->IsHTML(true);
if($mail->Send()) {
echo "Done";
}
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
?>