通过zoho邮件通过smtp发送电子邮件时出错

时间:2016-06-22 16:44:12

标签: c#-4.0 smtp zoho

我正在使用zoho电子邮件发送电子邮件。我在web.cfg中进行了以下配置。

   <add key="hostAddress" value="smtp.zoho.com" />
    <add key="portNo" value="587" />
    <add key="fromEmailAddress" value="info@something.com" />
    <add key="password" value="xxxxxxxxxxxx" />

通过以上配置发送电子邮件并使用SASL启用时,我收到以下错误。

ERROR t:186 22/06/2016 08:36:28 EmailHelper            SendMail :: Error Message: Failure sending mail. Exception Detail System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 165.254.168.48:587
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---

我可以帮助我,因为我已尝试过所有其他端口(465)。我在goDaddy服务器上有windows托管。我用C#.net mvc-4编写的代码。当API在localhost上时,我能够收到电子邮件,当我在GoDaddy上部署相同的代码时,它无法发送电子邮件。

0 个答案:

没有答案