I don't know why I get this error PHPMailer Mail Error - >SMTP connect()
. How can I solve it? I don't have any idea how can I do I need exactly explications, I'm new with PHP
<?php
require '../plugins/phpmailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->CharSet = "utf-8";
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->Username = "myemail@gmail.com";
$mail->Password = "mypass";
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = "587";
$mail->setFrom('your_gmail@gmail.com', 'your name');
$mail->AddAddress('to_mail@mail.com', 'receivers name');
$mail->Subject = 'using PHPMailer';
$mail->IsHTML(true);
$mail->Body = 'Hi there ,
<br />
this mail was sent using PHPMailer...
<br />
cheers... :)';
if ($mail->Send()) {
echo "Message was Successfully Send :)";
} else {
echo "Mail Error - >" . $mail->ErrorInfo;
}
?>