Sending emails

V

VK

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 = "(e-mail address removed)"
mail.To = "(e-mail address removed)"
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top