Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I don't understand why the following code does not work

 

Could someone enlighten me please!

 

 

Dim mailMessage As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage

mailMessage.From = "mymail@yahoo.com"

mailMessage.To = "mymail@yahoo.com"

mailMessage.Subject = "Email Subject"

mailMessage.Body = strMessage

mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text

 

' TODO: Set the mailMessage.Body property

 

System.Web.Mail.SmtpMail.SmtpServer = "colinlee.europe.webmatrixhosting.net"

System.Web.Mail.SmtpMail.Send(mailMessage)

 

:confused:

Hobbes...
Posted

Oops....

 

here it is ....

 

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.

 

Thanks :)

Hobbes...
Posted

Instead of this ...

 

System.Web.Mail.SmtpMail.SmtpServer = "colinlee.europe.webmatrixhosting.net"

System.Web.Mail.SmtpMail.Send(mailMessage)

 

 

I use the following...

 

SmtpMail.Send(mailMessage)

 

I found out from my hosting site at

 

europe.webmatrixhosting.net

 

go to their questions and answer. They have some helpful hints too

Hobbes...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...