email icon indicating copy to clipboard operation
email copied to clipboard

SendWithStartTLS:504 5.7.4 Unrecognized authentication type [HK2PR04CA0063.apcprd04.prod.outlook.com]

Open agoraluoru opened this issue 4 years ago • 1 comments

Hi, I have a problem. When I use the SendWithStartTLS function to send mail, It produces an error message: 504 5.7.4 Unrecognized authentication type [HK2PR04CA0063.apcprd04.prod.outlook.com],The code is as follows:

tlsConfig := &tls.Config{
	InsecureSkipVerify: true,
	ServerName:         smtpServerHost,
}
// send email with starttls
// smtpServerAddr contains host and port of smtp server
err := em.SendWithStartTLS(smtpServerAddr, smtp.PlainAuth("", username, password, smtpServerHost), tlsConfig)

What should I do?

agoraluoru avatar Mar 21 '22 07:03 agoraluoru

As I remember, outlook uses LOGIN auth. This kind of auth is not included in Go stdlib, so try something like https://gist.github.com/andelf/5118732.

UPD: it also seems like duplicate for https://github.com/jordan-wright/email/issues/113.

rpromyshlennikov avatar Jun 14 '22 08:06 rpromyshlennikov