通过Godaddy服务器在asp.net中发送邮件时出错 [英] Error in sending mail in asp.net through Godaddy Server
本文介绍了通过Godaddy服务器在asp.net中发送邮件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在通过smtp服务器在asp.net中发送电子邮件
Hi,
I am Sending an Email in asp.net through smtp server
public void SendMail()
{
SmtpClient smtpClient = new SmtpClient("relay-hosting.secureserver.net", 25);
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress(txtemail.Text, txtFirstName.Text);
//You can specify the host name or ipaddress of your server
//Default in IIS will be localhost
//smtpClient.Host = "smtp.gmail.com";
smtpClient.Credentials = new System.Net.NetworkCredential("vkundarapu@netpeach.com", "*******");
smtpClient.EnableSsl = false;
smtpClient.Port = 25;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
//smtpClient.Host = "localhost";
//Default port will be 25
//smtpClient.Port = 25;
//From address will be given as a MailAddress Object
message.From = fromAddress;
// To address collection of MailAddress
message.To.Add(strToEmail);
message.Subject = txtFirstName.Text;
////CC and BCC optional
//MailAddressCollection class is used to send the email to various users
// //You can specify Address as new MailAddress("admin1@yoursite.com")
// message.CC.Add("");
//message.CC.Add("");
//Body can be Html or text format
//Specify true if it is html message
message.IsBodyHtml = false;
// Message body content
string strMessageBody = "Name:" + "" + txtFirstName.Text.Trim() + System.Environment.NewLine + "LastName:" + "" + txtLastName.Text.Trim() + System.Environment.NewLine + "Title:" + "" + ddltitle.SelectedItem.Text
+ System.Environment.NewLine + "City:" + "" + txtemail.Text.Trim() + System.Environment.NewLine + "Phone:" + "" + txtphone.Text.Trim() + System.Environment.NewLine + "Ext" + "" + txtExt.Text
+ System.Environment.NewLine + "Company:" + "" + txtcomapny.Text + System.Environment.NewLine + "BusinessType:" + "" + Business.Value + System.Environment.NewLine + "Comments:" + "" + Message.Value;
message.Body = strMessageBody;
//Send SMTP mail
smtpClient.Send(message);
Clear();
System.Threading.Thread.Sleep(3000);
lblStatus.Text = "Email successfully sent.";
}
catch (Exception ex)
{
lblStatus.Text = "Send Email Failed.<br>" + ex.Message;
}
}
当我尝试发送显示错误
when i am trying to send it showing the Error
Send Email Failed.
Mailbox name not allowed. The server response was: sorry, your mail was administratively denied. (#5.7.1)
在此先感谢.
Thanks in advance.
推荐答案
错误本身是不言自明的.您可以找到很多主题讨论 ^ ].
可能您可能已经点击了他们的垃圾邮件过滤器.
看看这些讨论:
类似的讨论1 [ ^ ]
类似的讨论2 [
Error itself is quite self-explanatory. You can find quite a few thread discussion here[^].
Probably you might have hit their spam filter.
Have a look at these discussions:
Similar discussion 1[^]
Similar discussion 2[^]
http://tuvian.wordpress.com/2011/05/31/how-to-send-mail -using-gmail-in-asp-net-with-godaddy-server/ [
这篇关于通过Godaddy服务器在asp.net中发送邮件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文