473,386 Members | 1,823 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.

VB 2003, 0x80040213

Hi all.

I'm using the following code to attempt to send Email, it's part of an
application I'm writing. I don't need any fancy stuff, just a simple text
message. This code is just for testing but the final thing wont be any
different apart from dragging info from a database.

I can't get around the dreaded 0x80040213 error, The transport failed to
connect to the server.

From and To are definately correct, I've tried my ISP hostname, IP and
localhost and nothing changes, same error.

What pre-requisites do I need before I can send mail? Exchange? a local
SMTP server?

I've always understood as long as I have a Gateway connection to a router,
'localhost' should find my ISP and forward mail, as long as they receive on
port 25. I've checked all virus protection, port 25 is open, can't see
anything in the firewall that should cause a problem.

I've searched every group I can think of, most point to Exchange errors.
The annoying think is, I'm sure this worked 6 months ago!

Any help would be very much appreciated!
Dim mail As System.Web.Mail.SmtpMail
Dim msg As New System.Web.Mail.MailMessage

msg.From = txtFrom.Text
msg.To = txtRecip.Text
msg.Subject = txtSubject.Text
msg.Body = txtMessage.Text
msg.BodyFormat = MailFormat.Text

mail.SmtpServer = "localhost"

Try
mail.Send(msg)
Catch ex As Exception
MsgBox(ex.ToString)

While Not (ex.InnerException Is Nothing)
ex = ex.InnerException
MsgBox(ex.ToString)
End While

End Try
May 31 '06 #1
2 3141
You will need an SMTP server you can relay through. <localhost> refers to
the machine you are running the application from; most PCs don't have an SMTP
server or smartrelay on them, and <localhost> will not find your ISP, since
by definition <localhost> is the PC the application is running on.

You will need to know the Fully Qualified Domain Name (i.e.
servername.isp.com) of the SMTP server, and be allowed to relay through it.

--
--ewok
MCSA+M,MCSE, MCSD, MCDBA,MCITP
"Tull Clancey" wrote:
Hi all.

I'm using the following code to attempt to send Email, it's part of an
application I'm writing. I don't need any fancy stuff, just a simple text
message. This code is just for testing but the final thing wont be any
different apart from dragging info from a database.

I can't get around the dreaded 0x80040213 error, The transport failed to
connect to the server.

From and To are definately correct, I've tried my ISP hostname, IP and
localhost and nothing changes, same error.

What pre-requisites do I need before I can send mail? Exchange? a local
SMTP server?

I've always understood as long as I have a Gateway connection to a router,
'localhost' should find my ISP and forward mail, as long as they receive on
port 25. I've checked all virus protection, port 25 is open, can't see
anything in the firewall that should cause a problem.

I've searched every group I can think of, most point to Exchange errors.
The annoying think is, I'm sure this worked 6 months ago!

Any help would be very much appreciated!
Dim mail As System.Web.Mail.SmtpMail
Dim msg As New System.Web.Mail.MailMessage

msg.From = txtFrom.Text
msg.To = txtRecip.Text
msg.Subject = txtSubject.Text
msg.Body = txtMessage.Text
msg.BodyFormat = MailFormat.Text

mail.SmtpServer = "localhost"

Try
mail.Send(msg)
Catch ex As Exception
MsgBox(ex.ToString)

While Not (ex.InnerException Is Nothing)
ex = ex.InnerException
MsgBox(ex.ToString)
End While

End Try

Jun 1 '06 #2
Ah, this is all starting to ring bells!

Thanks,
Tull.

"ewok66" <ew****@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
You will need an SMTP server you can relay through. <localhost> refers to
the machine you are running the application from; most PCs don't have an
SMTP
server or smartrelay on them, and <localhost> will not find your ISP,
since
by definition <localhost> is the PC the application is running on.

You will need to know the Fully Qualified Domain Name (i.e.
servername.isp.com) of the SMTP server, and be allowed to relay through
it.

--
--ewok
MCSA+M,MCSE, MCSD, MCDBA,MCITP
"Tull Clancey" wrote:
Hi all.

I'm using the following code to attempt to send Email, it's part of an
application I'm writing. I don't need any fancy stuff, just a simple
text
message. This code is just for testing but the final thing wont be any
different apart from dragging info from a database.

I can't get around the dreaded 0x80040213 error, The transport failed to
connect to the server.

From and To are definately correct, I've tried my ISP hostname, IP and
localhost and nothing changes, same error.

What pre-requisites do I need before I can send mail? Exchange? a local
SMTP server?

I've always understood as long as I have a Gateway connection to a
router,
'localhost' should find my ISP and forward mail, as long as they receive
on
port 25. I've checked all virus protection, port 25 is open, can't see
anything in the firewall that should cause a problem.

I've searched every group I can think of, most point to Exchange errors.
The annoying think is, I'm sure this worked 6 months ago!

Any help would be very much appreciated!
Dim mail As System.Web.Mail.SmtpMail
Dim msg As New System.Web.Mail.MailMessage

msg.From = txtFrom.Text
msg.To = txtRecip.Text
msg.Subject = txtSubject.Text
msg.Body = txtMessage.Text
msg.BodyFormat = MailFormat.Text

mail.SmtpServer = "localhost"

Try
mail.Send(msg)
Catch ex As Exception
MsgBox(ex.ToString)

While Not (ex.InnerException Is Nothing)
ex = ex.InnerException
MsgBox(ex.ToString)
End While

End Try

Jun 1 '06 #3

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

Similar topics

0
by: Tom Petersen | last post by:
Our person who hosts our email recently migrated to Exchange 2003 and my ASP emailing code quit working. I was getting this error: CDO.Message.1 (0x80040213) The transport failed to connect to the...
22
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to...
0
by: Vittorio Pavesi | last post by:
Hi All, sometimes (1 e-mail sent every 80) I got the following error: System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server What does it mean ?...
0
by: nbissette | last post by:
I get this error "System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server." when trying to send an SMTP mail message. The only problem is that it is...
0
by: daredevil | last post by:
hi all, i am newbie here. i was trying to send mail from ASP, but i encountered the error as below:- CDO.Message.1 (0x80040213) The transport failed to connect to the server. i already google...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.