email SMTP vb.net window application

I have a vb.net windows application. I want to be able to send an email using SMTP. How do I do this?
Mike MillerSoftware EngineerAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
jtaylor8181Connect With a Mentor Commented:
Is this want you wanted?

Dim msg As New System.Net.Mail.MailMessage(from address, to address, subject, message)
Dim mailClient As New System.Net.Mail.SmtpClient(host) ' or (host, port)
mailClient.Send(msg)
msg.Dispose()

jtaylor
0
 
Mike MillerSoftware EngineerAuthor Commented:
Dim mailClient As New System.Net.Mail.SmtpClient(host) ' or (host, port)

can host be an ip address?
I'm getting 'failure sending outgoing message'
0
 
Mike MillerSoftware EngineerAuthor Commented:
nevermind, the virus scan was blocking it. i got it. thanks a bunch!
0
 
jtaylor8181Commented:
no problem, i'm glad that is what you were looking for.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.