本文介绍了不允许使用邮箱名称。服务器响应是:抱歉,该域名不在我允许的rcpthosts列表中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
无法从godaddy服务器发送电子邮件。获取以下错误,
不允许使用邮箱名称。服务器响应是:抱歉,该域名不在我允许的rcpthosts列表中。
这是我的代码片段。
Not able to send email from godaddy server. Getting following error,
Mailbox name not allowed. The server response was: Sorry, that domain isn''t in my list of allowed rcpthosts.
Here is my code snippet.
System.Net.Mail.SmtpClient Mail = new System.Net.Mail.SmtpClient();
Mail.Host = "smtpout.secureserver.net";
Mail.Port = 3535;
Mail.Timeout = 10000;
string username = null;
string Password = null;
Mail.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
username = txtUsername.Text.Trim();
Password = txtPassword.Text.Trim();
System.Net.NetworkCredential basicAuthenticationInfo = new System.Net.NetworkCredential(username, Password);
Mail.UseDefaultCredentials = false;
Mail.Credentials = basicAuthenticationInfo;
System.Net.Mail.MailMessage myMail = new System.Net.Mail.MailMessage();
myMail.Subject = "Test Email";
myMail.From = new System.Net.Mail.MailAddress(txtFrom.Text, txtFrom.Text);
myMail.To.Add(new System.Net.Mail.MailAddress(txtTo.Text));
myMail.IsBodyHtml = true;
myMail.Body = "Test Email";
try
{
Mail.Send(myMail);
lblmsg.Text = "Message send successfully.";
}
catch (Exception ex)
{
lblmsg.Text = ex.Message.ToString();
}
我尝试使用端口25和3535,但同样的错误即将发生。
I have tried with port 25 and 3535 but same error is coming.
推荐答案
这篇关于不允许使用邮箱名称。服务器响应是:抱歉,该域名不在我允许的rcpthosts列表中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!