在Godaddy Server发送邮件失败。任何解决方案? [英] Failure sending mail in Godaddy Server..Any Solution?
问题描述
在Godaddy服务器上发送邮件失败
am实现此代码...但不工作..生成邮件发送失败错误..
------ -----------------------------------
Failure sending mail in Godaddy Server
am Implement this code...but not working..generate mail sending failure error..
-----------------------------------------
const string SERVER = "relay-hosting.secureserver.net";
MailMessage oMail = new System.Web.Mail.MailMessage();
oMail.From = "mail@applemedicalcenter";
oMail.To = email;
oMail.Subject = "New Patient | Apple Medical Center";
oMail.BodyFormat = MailFormat.Html; // enumeration
oMail.Priority = MailPriority.High; // enumeration
oMail.Body = "Hi"
SmtpMail.SmtpServer = SERVER;
SmtpMail.Send(oMail);
oMail = null; // free up resources
// -------------------------------------------------- ---------------------
此代码也不起作用。
------- ----------------------
MailMessage message = new MailMessage();
SmtpClient smtp = new SmtpClient();
message.From = new MailAddress(mail @ applemedicalcenter);
message.To.Add(new MailAddress(email));
string msg =Admin \ n+\ n
++Mr / Mrs:+ name +已发出请求新的Patient.His详细信息如下:\ n
+RegId:+ RegNo +\ n
+年龄:+年龄+ \ n
+城市:+城市+\ n
+Emirat e:+位置+\ n
+国家:+国家+\ n
+手机:+联系+\\ \\ n
+日期:+天+\ n
+预先时间:+时间+\ n>
+预计时间:+预期_时间+\ n;
message.IsBodyHtml = true;
message.Subject =新病人| Apple医疗中心;
message.Body = msg;
smtp.Host =ay-hosting.secureserver.net;
smtp .Port = 25;
smtp.UseDefaultCredentials = false;
smtp.Send(message);
请帮助我......
产生此错误
//-----------------------------------------------------------------------
also this code not work.
-----------------------------
MailMessage message = new MailMessage();
SmtpClient smtp = new SmtpClient();
message.From = new MailAddress("mail@applemedicalcenter");
message.To.Add(new MailAddress(email));
string msg = "Hi, Admin\n" + "\n"
+ " " + "Mr/Mrs: " + name + " had sent a request for a new Patient.His details are mentioned below:\n"
+ "RegId :" + RegNo + " \n"
+ "Age :" + Age + " \n"
+ "City :" + City + " \n"
+ "Emirate :" + Location + " \n"
+ "Nation :" + Nation + " \n"
+ "Mobile :" + Contact + " \n"
+ "Date :" + Days + " \n"
+ "Pre-Time :" + Time + " \n"
+ "Expected Time :" + Expected_Time + " \n";
message.IsBodyHtml = true;
message.Subject = "New Patient | Apple Medical Center";
message.Body = msg;
smtp.Host = "relay-hosting.secureserver.net";
smtp.Port = 25;
smtp.UseDefaultCredentials = false;
smtp.Send(message);
Please Help me......
generate this error
System.Web.HttpException: The message could not be sent to the SMTP server. The transport error code was 0x800ccc6a. The server response was 451 See http://pobox.com/~djb/docs/smtplf.html. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040211): The message could not be sent to the SMTP server. The transport error code was 0x800ccc6a. The server response was 451 See http://pobox.com/~djb/docs/smtplf.html. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Type type, Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at RH_OnlineAppointment.New_Members.Send_Email_toadmin(String name, String mailid, String email, String RegNo, String Age, String City, String Location, String Nation, String Contact, String Days, String Time, String Expected_Time) in E:\Projects\RH_OnlineAppointment\RH_OnlineAppointment\RH_OnlineAppointment_User\RH_OnlineAppointment\New_Members.aspx.cs:line 237
推荐答案
最后我得到了解决方案..
// ------------
const string SERVER =relay-hosting.secureserver.net;
MailMessage oMail = new System.Net.Mail.MailMessage();
oMail.From = new MailAddress( mail @ applemedicalcenter);
oMail.To.Add(email);
oMail.Subject =现有患者| Apple医疗中心;
oMail.IsBodyHtml = true; //枚举
oMail.Priority = MailPriority.High; //枚举
oMail .Body =嗨;
SmtpClient客户端=新的SmtpClient(服务器);
Client.Send(oMail);
/ - ---------------
现在邮件发送完美.................!
finally i got the solution..
//------------
const string SERVER = "relay-hosting.secureserver.net";
MailMessage oMail = new System.Net.Mail.MailMessage();
oMail.From = new MailAddress("mail@applemedicalcenter");
oMail.To.Add(email);
oMail.Subject = "Existing Patient | Apple Medical Center";
oMail.IsBodyHtml = true; // enumeration
oMail.Priority = MailPriority.High; // enumeration
oMail.Body = "Hi";
SmtpClient Client = new SmtpClient(SERVER);
Client.Send(oMail);
/-----------------
now mail sending perfectly.................!
这篇关于在Godaddy Server发送邮件失败。任何解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!