soroosh.net
New Member
سلام دوستان.
میخوام یه email با asp.net بفرستم. اما نمیشه
پدرم رو در آورده
این کد رو مینویسم:
System.Web.Mail.MailMessage m=new System.Web.Mail.MailMessage();
m.Body="soroosh rahimi taghanaki";
System.Web.Mail.MailAttachment ma=new System.Web.Mail.MailAttachment("d:\\frontpg.log");
m.Attachments.Add(ma);
m.From="[email protected]";
m.Subject="salam";
m.To="[email protected]";
m.BodyFormat=System.Web.Mail.MailFormat.Html;
m.Priority=System.Web.Mail.MailPriority.High;
System.Web.Mail.SmtpMail.Send(m);
این error رو میده:
Server Error in '/tamrin' Application.
--------------------------------------------------------------------------------
The "SendUsing" configuration value is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid.
Source Error:
Line 58: m.BodyFormat=System.Web.Mail.MailFormat.Html;
Line 59: m.Priority=System.Web.Mail.MailPriority.High;
Line 60: System.Web.Mail.SmtpMail.Send(m);
Line 61: }
Line 62: }
Source File: d:\inetpub\wwwroot\tamrin\webform1.aspx.cs Line: 60
Stack Trace:
[COMException (0x80040220): The "SendUsing" configuration value is invalid.
]
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29
System.Web.Mail.LateBoundAccessHelper.CallMethod(Type type, Object obj, String methodName, Object[] args)
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)
[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)
System.Web.Mail.CdoSysHelper.Send(MailMessage message)
System.Web.Mail.SmtpMail.Send(MailMessage message)
tamrin.WebForm1.Button1_Click(Object sender, EventArgs e) in d:\inetpub\wwwroot\tamrin\webform1.aspx.cs:60
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
چی کار کنم؟
میخوام یه email با asp.net بفرستم. اما نمیشه

پدرم رو در آورده

این کد رو مینویسم:
System.Web.Mail.MailMessage m=new System.Web.Mail.MailMessage();
m.Body="soroosh rahimi taghanaki";
System.Web.Mail.MailAttachment ma=new System.Web.Mail.MailAttachment("d:\\frontpg.log");
m.Attachments.Add(ma);
m.From="[email protected]";
m.Subject="salam";
m.To="[email protected]";
m.BodyFormat=System.Web.Mail.MailFormat.Html;
m.Priority=System.Web.Mail.MailPriority.High;
System.Web.Mail.SmtpMail.Send(m);
این error رو میده:
Server Error in '/tamrin' Application.
--------------------------------------------------------------------------------
The "SendUsing" configuration value is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid.
Source Error:
Line 58: m.BodyFormat=System.Web.Mail.MailFormat.Html;
Line 59: m.Priority=System.Web.Mail.MailPriority.High;
Line 60: System.Web.Mail.SmtpMail.Send(m);
Line 61: }
Line 62: }
Source File: d:\inetpub\wwwroot\tamrin\webform1.aspx.cs Line: 60
Stack Trace:
[COMException (0x80040220): The "SendUsing" configuration value is invalid.
]
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29
System.Web.Mail.LateBoundAccessHelper.CallMethod(Type type, Object obj, String methodName, Object[] args)
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)
[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)
System.Web.Mail.CdoSysHelper.Send(MailMessage message)
System.Web.Mail.SmtpMail.Send(MailMessage message)
tamrin.WebForm1.Button1_Click(Object sender, EventArgs e) in d:\inetpub\wwwroot\tamrin\webform1.aspx.cs:60
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
چی کار کنم؟