Imports System.Net.Mail

 

 

copy the code below into a button click event

 

 

    Dim mail As New MailMessage()

 

   

        mail = New MailMessage()

        Dim SmtpServer As New SmtpClient()

        SmtpServer.Credentials = New Net.NetworkCredential("youremail@gmail.com", "pass")

        SmtpServer.Port = 587

        SmtpServer.Host = "smtp.gmail.com"

        SmtpServer.EnableSsl = True

        mail.From = New MailAddress("youremail@gmail.com","your name", System.Text.Encoding.UTF8)

        mail.To.Add("toemail@yahoo.com")

        mail.Subject = "first email msg "

         

 

        mail.Body = "some text"

        mail.ReplyTo = New MailAddress("toemail@yahoo.com")

        SmtpServer.Send(mail)

 

   

 

 

Note : in gmail setup set IMAP active