![]() Here are some articles of interest that helped me solve this: Disable the feature of blocking suspicious apps/technologies.If you've already tried everything, try doing this: Set who the message is to be sent the subject line Set an alternative reply-to 'Reply To') Set who the message is to be sent 'From where it is sent') $mail->Username = to use for SMTP authentication Username to use for SMTP authentication Set the SMTP port number - likely to be 25, 465 or 587 SMTP::DEBUG_SERVER = client and server messages SMTP::DEBUG_OFF = off (for production use) I have found a solution and it is working. You can go to the following stackoverflow answer link for more detailed reference. ![]() Link to disable the feature of blocking suspicious apps/technologies: View recent attempts to use the account and accept suspicious access. Links that fix the problem (you must be logged into google account): This problem can be caused by either 'less secure' applications trying to use the email account (this is according to google help, not sure how they judge what is secure and what is not) OR if you are trying to login several time in a row OR if you change countries (for example use VPN, move code to different server or actually try to login from different part of the world). " SMTP connect() failed " and " SMTP ERROR: Password command failed " I had to lower my gmail account security settings to get rid of errors: Example - Performing verification if mail is sent, using json to pass data through ajax. Setting it to 1, can cause errors especially if you are passing some data as json to next page. Some SMTP servers don't support SSL (or TLS) connections.Īnderscc has got it correct. It's worth noting that some SMTP servers block connections. You could try changing $mail->SMTP to: $mail->SMTPSecure = 'tls' It could be that you needed $mail->SMTPSecure = 'ssl' Īlso make sure you don't have two step verification switched on for that account as that can cause problems also. This code above has been tested and worked for me. $mail->SMTPSecure = 'ssl' // secure transfer enabled REQUIRED for Gmail $mail->SMTPAuth = true // authentication enabled $mail->SMTPDebug = 1 // debugging: 1 = errors and messages, 2 = messages only $mail = new PHPMailer() // create a new object $mail->ErrorInfo īut I receive this following error Mailer Error: SMTP Error: The following recipients failed: server error: SMTP AUTH is required for message submission on port 587 $mail->AltBody = "To view the message, please use an HTML compatible email viewer!" Įcho "Mailer Error: ". $mail->Subject = "PHPMailer Test Subject via Sendmail, basic" I would like to send an email using Gmail SMTP server through PHP Mailer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |