By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,199 Members | 1,458 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,199 IT Pros & Developers. It's quick & easy.

Error: The transport failed to connect to the server

P: n/a
I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send()
method. My code contains all of the following:
Dim mailmsg As New Mail.MailMessage
Mail.SmtpMail.SmtpServer =
System.Configuration.ConfigurationSettings.AppSett ings("smtpserver")
mailmsg.BodyFormat = Mail.MailFormat.Text

mailmsg.Subject = "My Subject"
mailmsg.Body = "My Body"
mailmsg.To = "my*****@myhost.com;"
mailmsg.From = "My From Address"

Mail.SmtpMail.Send(mailmsg)
When I test the application, I recieve the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The transport failed to connect to the server.
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
transport failed to connect to the server.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[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) +1846
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
AFBE.addathlete.SendEmailNotification(String id)
AFBE.addathlete.btnSubmit_Click(Object sender, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1273

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
What am I forgetting here? Or is my webhost simply down right now? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Dec 8 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
the error is pretty clear. the smtp connection settings are not correct.

-- bruce (sqlwork.com)

Nathan Sokalski wrote:
I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send()
method. My code contains all of the following:
Dim mailmsg As New Mail.MailMessage
Mail.SmtpMail.SmtpServer =
System.Configuration.ConfigurationSettings.AppSett ings("smtpserver")
mailmsg.BodyFormat = Mail.MailFormat.Text

mailmsg.Subject = "My Subject"
mailmsg.Body = "My Body"
mailmsg.To = "my*****@myhost.com;"
mailmsg.From = "My From Address"

Mail.SmtpMail.Send(mailmsg)
When I test the application, I recieve the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The transport failed to connect to the server.
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
transport failed to connect to the server.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[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) +1846
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
AFBE.addathlete.SendEmailNotification(String id)
AFBE.addathlete.btnSubmit_Click(Object sender, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1273

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
What am I forgetting here? Or is my webhost simply down right now? Thanks.
Dec 8 '06 #2

P: n/a
one of the possible reason is your smtp server requires a login, contact
your system administrator about that. in .Net framework 1.1, you can use the
fields from the Mail object to add the attribute to pass the login
(username, password, smtpserver, smtpserver port number). Let me know if you
need the codes.

--ricky

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:Oc**************@TK2MSFTNGP06.phx.gbl...
>I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send()
method. My code contains all of the following:
Dim mailmsg As New Mail.MailMessage
Mail.SmtpMail.SmtpServer =
System.Configuration.ConfigurationSettings.AppSett ings("smtpserver")
mailmsg.BodyFormat = Mail.MailFormat.Text

mailmsg.Subject = "My Subject"
mailmsg.Body = "My Body"
mailmsg.To = "my*****@myhost.com;"
mailmsg.From = "My From Address"

Mail.SmtpMail.Send(mailmsg)
When I test the application, I recieve the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The transport failed to connect to the server.
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
transport failed to connect to the server.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[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) +1846
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
AFBE.addathlete.SendEmailNotification(String id)
AFBE.addathlete.btnSubmit_Click(Object sender, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1273

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032
What am I forgetting here? Or is my webhost simply down right now? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Dec 9 '06 #3

P: n/a
I concur.

The mail page/app is not able to connect to the smtp server.

Nathan should look into naming or availability issues.

I once got that message when I used "localhost" as my smtp server name.

When I created an smtp server virtual instance named for my machine's name,
everything worked, although I still had mail rejection problems ( mail servers don't
like receiving mail from single-name machines, instead of from properly-named mail servers ).

They went away when I used my domain name, instead of my machine name,
after creating an smtp virtual server named for my domain.

I removed the following two newsgroups from the address list :

microsoft.public.dotnet.framework.adonet
and
microsoft.public.dotnet.languages.vb

The problem is not related to a database nor to the VB language.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"bruce barker" <no****@nospam.comwrote in message news:eI*************@TK2MSFTNGP06.phx.gbl...
the error is pretty clear. the smtp connection settings are not correct.

-- bruce (sqlwork.com)

Nathan Sokalski wrote:
>I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send() method. My code
contains all of the following:
Dim mailmsg As New Mail.MailMessage
Mail.SmtpMail.SmtpServer = System.Configuration.ConfigurationSettings.AppSett ings("smtpserver")
mailmsg.BodyFormat = Mail.MailFormat.Text

mailmsg.Subject = "My Subject"
mailmsg.Body = "My Body"
mailmsg.To = "my*****@myhost.com;"
mailmsg.From = "My From Address"

Mail.SmtpMail.Send(mailmsg)
When I test the application, I recieve the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The transport failed to connect to the server.
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 transport failed to connect
to the server.

Source Error:

An unhandled exception was generated during the execution of the current web request.
Information regarding the origin and location of the exception can be identified using the
exception stack trace below.

Stack Trace:

[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) +1846
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
AFBE.addathlete.SendEmailNotification(String id)
AFBE.addathlete.btnSubmit_Click(Object sender, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String
eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1273

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
What am I forgetting here? Or is my webhost simply down right now? Thanks.


Dec 9 '06 #4

P: n/a
Yes, I think I do need them. Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Ricky Yau" <ry**@nowcom.comwrote in message
news:ei*************@TK2MSFTNGP02.phx.gbl...
one of the possible reason is your smtp server requires a login, contact
your system administrator about that. in .Net framework 1.1, you can use
the fields from the Mail object to add the attribute to pass the login
(username, password, smtpserver, smtpserver port number). Let me know if
you need the codes.

--ricky

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:Oc**************@TK2MSFTNGP06.phx.gbl...
>>I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send()
method. My code contains all of the following:
Dim mailmsg As New Mail.MailMessage
Mail.SmtpMail.SmtpServer =
System.Configuration.ConfigurationSettings.AppSet tings("smtpserver")
mailmsg.BodyFormat = Mail.MailFormat.Text

mailmsg.Subject = "My Subject"
mailmsg.Body = "My Body"
mailmsg.To = "my*****@myhost.com;"
mailmsg.From = "My From Address"

Mail.SmtpMail.Send(mailmsg)
When I test the application, I recieve the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The transport failed to connect to the server.
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
transport failed to connect to the server.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[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) +1846
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
AFBE.addathlete.SendEmailNotification(String id)
AFBE.addathlete.btnSubmit_Click(Object sender, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IP ostBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1273

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032
What am I forgetting here? Or is my webhost simply down right now?
Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/


Dec 9 '06 #5

P: n/a
here you go:

objEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver",
yourSMTPServer);
objEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport",
25); //maybe a different port, 25 is the default
objEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing",
2);
objEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
1);
objEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
yourUsername);
objEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
yourPassword);

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:Oa****************@TK2MSFTNGP02.phx.gbl...
Yes, I think I do need them. Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Ricky Yau" <ry**@nowcom.comwrote in message
news:ei*************@TK2MSFTNGP02.phx.gbl...
>one of the possible reason is your smtp server requires a login, contact
your system administrator about that. in .Net framework 1.1, you can use
the fields from the Mail object to add the attribute to pass the login
(username, password, smtpserver, smtpserver port number). Let me know if
you need the codes.

--ricky

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:Oc**************@TK2MSFTNGP06.phx.gbl...
>>>I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send()
method. My code contains all of the following:
Dim mailmsg As New Mail.MailMessage
Mail.SmtpMail.SmtpServer =
System.Configuration.ConfigurationSettings.AppSe ttings("smtpserver")
mailmsg.BodyFormat = Mail.MailFormat.Text

mailmsg.Subject = "My Subject"
mailmsg.Body = "My Body"
mailmsg.To = "my*****@myhost.com;"
mailmsg.From = "My From Address"

Mail.SmtpMail.Send(mailmsg)
When I test the application, I recieve the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The transport failed to connect to the server.
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
transport failed to connect to the server.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[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) +1846
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
AFBE.addathlete.SendEmailNotification(String id)
AFBE.addathlete.btnSubmit_Click(Object sender, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.I PostBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1273

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032
What am I forgetting here? Or is my webhost simply down right now?
Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/



Dec 11 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.