T
Tull Clancey
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
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