473,386 Members | 1,773 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,386 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
0 1102

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

Similar topics

8
by: Jason | last post by:
Hi not sure if this is the write place, but i really need some help with this...! I have a piece of code that sends email using the SmtpMail class, in an ASP.NET web application, with...
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...
5
by: ElanKathir | last post by:
Hi ! I wrote one code for Send the E-mail, But that code have some problem , So please help me Here i paste my code and Error: Error: Server Error in '/Elan_Sample' Application. ...
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 =...
2
by: Edward | last post by:
Hello, everybody, I tried to send Email out using ASP.NET, but failed, here is the code of sending: -------------------------------------------------------------------------------- Try...
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...
19
by: zdrakec | last post by:
Hello all: Using an "Imports System.Web.Mail" clause at the head of my module, and after executing the following code: Dim msg As New MailMessage msg.From = sender msg.To = recipient...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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,...

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.