Search code examples
phpmailertelnet

SMTP login only works via AUTH PLAIN


This is my first time using telnet; I'm using it to debug PHPMailer. Here's what I get when logged in:

EHLO localserver.com
250-mx.zohomail.com Hello localserver.com (162.243.32.109 (162.243.32.109))
250-AUTH LOGIN PLAIN
250 SIZE 53477376

Following this tutorial, I try logging in via AUTH LOGIN.

When I give my password, it fails.

However, if I AUTH PLAIN, it works.

PHPMailer (I'm using the basic template provided at their git page with debugging set to 4) debugging shows me that they are using AUTH LOGIN.

So it seems that there are two ways to solve my problem.

-figure out why AUTH LOGIN doesn't work

-figure out how to get PHPMailer to use AUTH PLAIN.

Thanks


Solution

  • You can set the authentication type with the AuthType property. Just set it to PLAIN.

    You don't need to use SMTPDebug = 4; 2 should be enough for this.