473,396 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

SmtpMail.Send Error

I am getting the following error when trying to send the
mail object:
COMException (0x80040213): The transport failed to connect
to the server.
]

[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(O bject
obj, String methodName, Object[] args) +58

[HttpException (0x80004005): Could not
access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject
obj, String methodName, Object[] args) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message)
+1512
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
Forms.AddStore.Page_Error(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\Forms\AddStore.aspx.vb:137
System.Web.UI.TemplateControl.OnError(EventArgs e) +109
System.Web.UI.Page.HandleError(Exception e) +68
System.Web.UI.Page.ProcessRequestMain() +2065
System.Web.UI.Page.ProcessRequest() +118
System.Web.UI.Page.ProcessRequest(HttpContext context)
+18
System.Web.CallHandlerExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep
step, Boolean& completedSynchronously) +87

Here is the code I am using:
Dim objMail As New Mail.MailMessage()
Dim objSmtp As Mail.SmtpMail
Dim ErrorMessage As String = "The following errors
occurred: " & ControlChars.CrLf & ex.ToString
objMail.To = "yo*@home.com"
objMail.From = "me@work.com"
objMail.Priority = MailPriority.High
objMail.BodyFormat = MailFormat.Text
objMail.Subject = "Error On AddStore.aspx Page"
objMail.Body = ErrorMessage
objSmtp.SmtpServer = "localhost"
objSmtp.Send(objMail)
objMail = Nothing
objSmtp = Nothing

The only thing I changed in this posting was the email
addresses.
I have also tried not setting the SmtpServer property to
let it use the default.
Not sure what is wrong since I had it working before.

Thanks
Nov 18 '05 #1
2 1312
I don't know what I did but it is working again.
Wierd.
-----Original Message-----
I am getting the following error when trying to send the
mail object:
COMException (0x80040213): The transport failed to connectto the server.
]

[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 (Objectobj, String methodName, Object[] args) +58

[HttpException (0x80004005): Could not
access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod (Objectobj, String methodName, Object[] args) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message)
+1512
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
Forms.AddStore.Page_Error(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\Forms\AddStore.aspx.vb:137
System.Web.UI.TemplateControl.OnError(EventArgs e) +109
System.Web.UI.Page.HandleError(Exception e) +68
System.Web.UI.Page.ProcessRequestMain() +2065
System.Web.UI.Page.ProcessRequest() +118
System.Web.UI.Page.ProcessRequest(HttpContext context)
+18
System.Web.CallHandlerExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep
step, Boolean& completedSynchronously) +87

Here is the code I am using:
Dim objMail As New Mail.MailMessage()
Dim objSmtp As Mail.SmtpMail
Dim ErrorMessage As String = "The following errorsoccurred: " & ControlChars.CrLf & ex.ToString
objMail.To = "yo*@home.com"
objMail.From = "me@work.com"
objMail.Priority = MailPriority.High
objMail.BodyFormat = MailFormat.Text
objMail.Subject = "Error On AddStore.aspx Page"
objMail.Body = ErrorMessage
objSmtp.SmtpServer = "localhost"
objSmtp.Send(objMail)
objMail = Nothing
objSmtp = Nothing

The only thing I changed in this posting was the email
addresses.
I have also tried not setting the SmtpServer property to
let it use the default.
Not sure what is wrong since I had it working before.

Thanks
.

Nov 18 '05 #2
I don't know what I did but it is working again.
Wierd.
-----Original Message-----
I am getting the following error when trying to send the
mail object:
COMException (0x80040213): The transport failed to connectto the server.
]

[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 (Objectobj, String methodName, Object[] args) +58

[HttpException (0x80004005): Could not
access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod (Objectobj, String methodName, Object[] args) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message)
+1512
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
Forms.AddStore.Page_Error(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\Forms\AddStore.aspx.vb:137
System.Web.UI.TemplateControl.OnError(EventArgs e) +109
System.Web.UI.Page.HandleError(Exception e) +68
System.Web.UI.Page.ProcessRequestMain() +2065
System.Web.UI.Page.ProcessRequest() +118
System.Web.UI.Page.ProcessRequest(HttpContext context)
+18
System.Web.CallHandlerExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep
step, Boolean& completedSynchronously) +87

Here is the code I am using:
Dim objMail As New Mail.MailMessage()
Dim objSmtp As Mail.SmtpMail
Dim ErrorMessage As String = "The following errorsoccurred: " & ControlChars.CrLf & ex.ToString
objMail.To = "yo*@home.com"
objMail.From = "me@work.com"
objMail.Priority = MailPriority.High
objMail.BodyFormat = MailFormat.Text
objMail.Subject = "Error On AddStore.aspx Page"
objMail.Body = ErrorMessage
objSmtp.SmtpServer = "localhost"
objSmtp.Send(objMail)
objMail = Nothing
objSmtp = Nothing

The only thing I changed in this posting was the email
addresses.
I have also tried not setting the SmtpServer property to
let it use the default.
Not sure what is wrong since I had it working before.

Thanks
.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Leszek | last post by:
Hello, I have created a simple code to send emails using the MailMessage class and the SmtpMail.Send() method: MailMessage mail = new MailMessage(); mail.From = echidna@somewhere.com; //...
6
by: Cameron Eckman | last post by:
I get various errors when I try to use email on the machine I have. XP professional. It works fine on another machine with NT 2000 server. Below is the code: 'BEGIN CODE Dim oMail As New...
0
by: Chris Lane | last post by:
I am getting the following error when trying to send the mail object: COMException (0x80040213): The transport failed to connect to the server. ] System.RuntimeType.InvokeDispMethod(String...
0
by: Erwan | last post by:
I have a strange (but very blocking) result when using the smtpmail class from an ASPX page : here is the (very simple !) code... '-------------------------------------------------- mail.To =...
1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
4
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP...
6
by: JIM.H. | last post by:
Hello, I am using SmtpMail.Send() and I get the following message The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for myMail@hotmail.com...
2
by: kmbarz | last post by:
I'm trying to expand my horizons here by working through an ASP.Net book. When I do the example that uses: Line 55: Mail.From = "feedback@graymad.com" Line 56: ...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.