php smtp authentication issue

This is mail1.php page, when I started to use I receive authentication error.


 include 'class.phpmailer.php';
 $mail = new PHPMailer(); // create a new object
 $mail->IsSMTP(); // enable SMTP
 $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
 $mail->SMTPAuth = true; // authentication enabled
 $mail->Host = "";
 $mail->Port = 465; // 587
 $mail->Username = "";
 $mail->Password = "**********"; //Don't reveal password with others
 $mail->Subject = "Test";
 $mail->Body = "hello";
 echo "Mailer Error: " . $mail->ErrorInfo;
 echo "Message has been sent";

I received below error message. I changed port numbers and try again, but no result. Can anyone help me ?

 SMTP -> ERROR: AUTH not accepted from server: 530 5.7.0 Must issue a STARTTLS command 
 first. 8sm65292722eeq.15 - gsmtp SMTP Error: Could not authenticate. Mailer Error: 
 SMTP Error: Could not authenticate


Please try:

$mail->Host = "ssl://";

to enable SSL.

Need Your Help

Inputting data from url GET into a form and submitting on page load with javascript which then loads an ajax map causes the script to loop

javascript html ajax loops get

I've got a store locator currently on my website - this works by loading an ajax map when the user enters a postcode, this all works fine on the one page that it is on.