0
votes

I can send email from localhost.But when I sent an email from internet space I encountered a problem. Is the problem in website panel? How can I solve it?

System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)

at System.Net.Mail.SmtpClient.Send(MailMessage message)

at Defraz.Movafaqiyat.WebApp.usercontrols.AppCodes.MailHelper.SendMailMessage(String from, String to, String bcc, String cc, String subject, String body, String domainName, Boolean isBodyHtml)

a part of webconfig:

<smtp from="[email protected]">
    <network host="smtp.gmail.com" port="587" userName="[email protected]" password="mypassword" defaultCredentials="false" enableSsl="true" />
  </smtp>
1
If I were in your shoes I'd contact hosting provider. It could be some network related issue. - brke

1 Answers

0
votes

Try to use port="465" (Set up POP in mail clients) and make sure this port is open on the server you use for sending email.