Hobbes Posted May 23, 2003 Posted May 23, 2003 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: Quote Hobbes...
Administrators PlausiblyDamp Posted May 23, 2003 Administrators Posted May 23, 2003 What actually happens when you try this, do you get any errors and if so which line. Or does it appear to work and no e-mail arrives? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Hobbes Posted May 23, 2003 Author Posted May 23, 2003 It gaves me an error message on the page Quote Hobbes...
Administrators PlausiblyDamp Posted May 23, 2003 Administrators Posted May 23, 2003 any error in particualr, Exception names or error codes will make it easier for other people to help ;) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Hobbes Posted May 23, 2003 Author Posted May 23, 2003 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 :) Quote Hobbes...
Hobbes Posted May 23, 2003 Author Posted May 23, 2003 Thanks guys... I kinda figure it out... Love this forum! Quote Hobbes...
wyrd Posted May 23, 2003 Posted May 23, 2003 So tell us what the problem was and how you solved it. :) Quote Gamer extraordinaire. Programmer wannabe.
Hobbes Posted May 24, 2003 Author Posted May 24, 2003 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 Quote Hobbes...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.