I am using below Code for SMTP Configuration.
SmtpClient smtp = new SmtpClient
{
Host = data.SMTPServer, // smtp server address here...
Port = data.PortNo,
EnableSsl = data.SSL,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new System.Net.NetworkCredential(senderID, senderPassword),
Timeout = 30000,
};
smtp.Send(message);
One client has configured SMTP Server - smtp.office365.com.
SMTP Server throws back below Error - Without SSL:-
Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail [XXX.XXX.PROD.OUTLOOK.COM]
With SSL:-
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 Client not authenticated to send mail. [XXXX.XXXX.PROD.OUTLOOK.COM]
Above SMTP Code works perfectly for rest of Clients. Any inputs what needs to be done to fix this?
Make sure that the points below are correct:
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.