A
Arvind P Rangan
Hi,
How many have succesfully send mail using ASP.NEt.
Kindly give me the example.
I have code which uses the following.
The Code as follows:
Dim strBody As String = "This is the body of the e-mail"
Dim strFrom As String = (e-mail address removed)
Dim strTo As String = (e-mail address removed)
' Dim a MailPriority Type, valid values are
'Normal, Low and High
Dim mprPriority As MailPriority = MailPriority.High
Dim strSubject As String = "This is the subject of the e-mail."
' Create an instance of our MailMessage Object.
Dim theMailMessage As New MailMessage()
' Assign values to the MailMessage Objects fields.
theMailMessage.From = strFrom
theMailMessage.To = strTo
theMailMessage.Subject = strSubject
theMailMessage.Priority = mprPriority
theMailMessage.Body = strBody
'Send the MailMessage using the SmtpMail class' Send method.
SmtpMail.Send(theMailMessage)
Try
SmtpMail.Send(theMailMessage)
Catch ex As Exception
Response.Write(ex)
End Try
The Error I get is :
[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.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +58
[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1516
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
WebTest.EMail.btSend_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebTest\EMail.aspx.vb:73
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263
What is this Problem how to solve it.
Thanks
Arvind P Rangan.
How many have succesfully send mail using ASP.NEt.
Kindly give me the example.
I have code which uses the following.
The Code as follows:
Dim strBody As String = "This is the body of the e-mail"
Dim strFrom As String = (e-mail address removed)
Dim strTo As String = (e-mail address removed)
' Dim a MailPriority Type, valid values are
'Normal, Low and High
Dim mprPriority As MailPriority = MailPriority.High
Dim strSubject As String = "This is the subject of the e-mail."
' Create an instance of our MailMessage Object.
Dim theMailMessage As New MailMessage()
' Assign values to the MailMessage Objects fields.
theMailMessage.From = strFrom
theMailMessage.To = strTo
theMailMessage.Subject = strSubject
theMailMessage.Priority = mprPriority
theMailMessage.Body = strBody
'Send the MailMessage using the SmtpMail class' Send method.
SmtpMail.Send(theMailMessage)
Try
SmtpMail.Send(theMailMessage)
Catch ex As Exception
Response.Write(ex)
End Try
The Error I get is :
[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.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +58
[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1516
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
WebTest.EMail.btSend_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebTest\EMail.aspx.vb:73
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263
What is this Problem how to solve it.
Thanks
Arvind P Rangan.