I have placed phpmailer folder into my public_html folder in my web hosting account, but once i test the code i am not getting any error messages, all i am getting is this message.
The webpage.com page isn’t working
webpage.com is currently unable to handle this request.
HTTP ERROR 500
here is my code
<?php
require_once("/home/webfolder/public_html/PHPMailer_5.2.0/class.phpmailer.php");
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->Host = "mail.example.com";
$mail->SMTPAuth = true;
$mail->Username = "test@example.com";
$mail->Password ="password";
$mail->From =("sender@mailer.com");
$mail->FromName = "John Smith";
$mail->AddAddress="test@example.com";
$mail->WordWrap="50";
$mail->IsHTML(true);
$mail->SMTPDebug = 1;
$mail->Port = 26;
$mail->SMTPSecure = "ssl";
$mail->Subject = "Helloworld of SMTP";
$mail->Body = "This is the first email sent from PHP";
$mail->AltBody = "this is alternative mail";
if(!$mail->Send()){
echo "Mailer Error: " . $mail->ErrorInfo;
}else{
echo "Message has been sent";
}
?>
i have placed this code in a file called testmailer.php outside phpmailer folder so i usually test the code in a path like this
http://domain.com/testmailer.php