Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net.Mail
- Public Class Form1
- Dim SmtpServer As New SmtpClient()
- Dim mail As New MailMessage()
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- sendEmail()
- End Sub
- Sub sendEmail()
- Try
- SmtpServer.Credentials = New Net.NetworkCredential("YOUREMAIL@yahoo.com", "PASSWORD")
- SmtpServer.Port = "587"
- SmtpServer.Host = "smtp.mail.yahoo.com"
- mail.From = New MailAddress("YOUREMAIL@yahoo.com")
- mail.To.Add("YOUREMAIL@yahoo.com")
- mail.Subject = "SUBJECT GOES HERE"
- mail.Body = "BODY OF EMAIL"
- SmtpServer.Send(mail)
- Catch ex As Exception
- End Try
- End Sub
- End Class
Add Comment
Please, Sign In to add comment