|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Sending emailsI am trying to send one simple email. However each time I try this I get the following error: The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available. Here is my code: Function SendEmail() Dim mail As New MailMessage mail.Fields.Add ("http://schemas.microsoft.com/cdo/configuration/smtpauthen ticate", 1) mail.Fields.Add ("http://schemas.microsoft.com/cdo/configuration/senduserna me", "user") mail.Fields.Add ("http://schemas.microsoft.com/cdo/configuration/sendpasswo rd", "***") mail.From = "u***@user.com" mail.To = "myem***@myemail.com" mail.Subject = "test" 'Server.GetLastError.Message mail.Body = "body" 'Server.GetLastError.StackTrace SmtpMail.SmtpServer = "mail.myemail.net" SmtpMail.Send(mail) End Function I have replaced the from, to, smtp server in this email with some fake data, however in my application I am using the real data. Any idea? Here is good resource that might be helpful:
http://www.systemwebmail.com/faq.aspx http://www.systemwebmail.net/faq/3.8.aspx Show quoteHide quote "VK" <anonym***@discussions.microsoft.com> wrote in message news:142b01c5412f$ecfae0a0$a601280a@phx.gbl... > Hello, > > I am trying to send one simple email. However each time > I try this I get the following error: > > The message could not be sent to the SMTP server. The > transport error code was 0x80040217. The server response > was not available. > > Here is my code: > > Function SendEmail() > Dim mail As New MailMessage > mail.Fields.Add > ("http://schemas.microsoft.com/cdo/configuration/smtpauthen > ticate", 1) > mail.Fields.Add > ("http://schemas.microsoft.com/cdo/configuration/senduserna > me", "user") > mail.Fields.Add > ("http://schemas.microsoft.com/cdo/configuration/sendpasswo > rd", "***") > > mail.From = "u***@user.com" > mail.To = "myem***@myemail.com" > mail.Subject = "test" 'Server.GetLastError.Message > mail.Body = "body" 'Server.GetLastError.StackTrace > > SmtpMail.SmtpServer = "mail.myemail.net" > SmtpMail.Send(mail) > > End Function > > I have replaced the from, to, smtp server in this email > with some fake data, however in my application I am using > the real data. > > Any idea?
Other interesting topics
Session("passed") = Session("passed") + 1 error
FormsAuthentication.SignOut() not working when manually creating a ticket? cheap and reliable ASP.Net web hoster Custom ToolBoxItem type: Size vs Width in ASP.net Calling the window dialog window Q: select value in dropdown list DataReader... and ... What did visual studio do? Q: sum grid column |
|||||||||||||||||||||||