通过Godaddy的服务器在ASP.NET无法发送电子邮件 [英] Cannot send email in ASP.NET through Godaddy servers
问题描述
我在主持一个GoDaddy的ASP.NET应用程序,我想从发送电子邮件。当它运行时,我得到:邮箱名称不允许的。服务器响应为:对不起,中继来自您的位置否认的code和Web.config中的重要部分如下:
I have an ASP.NET application hosted on Godaddy that I want to send email from. When it runs, I get: Mailbox name not allowed. The server response was: sorry, relaying denied from your location. The important parts of the code and Web.config are below:
msg = new MailMessage("accounts@greektools.net", email);
msg.Subject = "GreekTools Registration";
msg.Body =
"You have been invited by your organization to register for the GreekTools recruitment application.<br/><br/>" +
url + "<br/><br/>" +
"Sincerely,<br/>" +
"The GreekTools Team";
msg.IsBodyHtml = true;
client = new SmtpClient();
client.Host = "relay-hosting.secureserver.net";
client.Send(msg);
<system.net>
<mailSettings>
<smtp from="accounts@greektools.net">
<network host="relay-hosting.secureserver.net" port="25" userName="********" password="*********" />
</smtp>
</mailSettings>
推荐答案
1 - 如果您的网站上GoDaddy的托管,你可能会使用relay-hosting.secureserver.net没有凭据。
1- If your site is hosted on godaddy you may use "relay-hosting.secureserver.net" without credentials.
2 - 如果你的网站是GoDaddy的外部托管您可以使用smtpout.secureserver.net与您的电子邮件帐户凭据。
2- If your site is hosted outside of godaddy you may use "smtpout.secureserver.net" with you email account credentials.
PS:请更改端口3535,如果你有25的问题
PS: Please change port 3535 if you have problems with 25
主办GoDaddy的
<system.net>
<mailSettings>
<smtp from="abc@xyz.net">
<network host="relay-hosting.secureserver.net"/>
</smtp>
</mailSettings>
</system.net>
外部
<system.net>
<mailSettings>
<smtp from="abc@xyz.net">
<network host="smtpout.secureserver.net"
userName="abc@xyz.net" password="your_password_here"
port="25" />
</smtp>
</mailSettings>
</system.net>
这篇关于通过Godaddy的服务器在ASP.NET无法发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!