Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net.Mail
- Public Class MainForm
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- EmailNow()
- End Sub
- Public Sub EmailNow()
- Dim SmtpServer As New SmtpClient()
- Dim mail As New MailMessage()
- SmtpServer.Port = 587
- SmtpServer.Host = "smtp.gmail.com"
- mail = New MailMessage()
- mail.Subject = "Test Mail"
- mail.Body = "This is for testing SMTP mail from GMAIL"
- SmtpServer.Send(mail)
- MsgBox("mail send")
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement