Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public sub SendEmail(byval Body as string,byval Subject as string, byval TO as string, byval FROM as string, byval SenderPassword as string, byval SenderCliant as string = "smtp.gmail.com")
- Dim Mail As New MailMessage
- Mail.Subject = Subject
- Mail.To.Add(TO)
- Mail.From = New MailAddress(FROM)
- Mail.Body = Body
- Dim SMTP As New SmtpClient(SenderCliant)
- SMTP.EnableSsl = True
- SMTP.Credentials = New System.Net.NetworkCredential(FROM, SenderPassword)
- SMTP.Port = "587"
- SMTP.Send(Mail)
- End Function
Advertisement
Add Comment
Please, Sign In to add comment