Advertisement
VladislavSavvateev

SMTP Spammer

Feb 2nd, 2016
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.31 KB | None | 0 0
  1. Public Class Main
  2.  
  3.     Dim thread As New Threading.Thread(AddressOf Thread_Work)
  4.  
  5.     Private Sub btnStart_Click(sender As Object, e As EventArgs) Handles btnStart.Click
  6.         If btnStart.Text = "Start!" Then
  7.             thread.Start()
  8.             btnStart.Text = "Stop and exit!"
  9.         Else
  10.             thread.Abort()
  11.             Me.Close()
  12.         End If
  13.     End Sub
  14.  
  15.     Public Sub Thread_Work()
  16.         Dim host As String = "smtp."
  17.         Dim counter As Integer = 0
  18.         Dim login As String = ""
  19.         For i = 0 To txtEmail.Text.Length - 1
  20.             If txtEmail.Text(i) = "@" Then
  21.                 counter = i + 1
  22.                 Exit For
  23.             Else
  24.                 login &= txtEmail.Text(i)
  25.             End If
  26.         Next
  27.         For i = counter To txtEmail.Text.Length - 1
  28.             host &= txtEmail.Text(i)
  29.         Next
  30.         Dim smtp As New Net.Mail.SmtpClient(host)
  31.         smtp.Credentials = New Net.NetworkCredential(login, txtPassword.Text)
  32.         smtp.EnableSsl = True
  33.         Do
  34.             Try
  35.                 smtp.Send(txtEmail.Text, txtTarget.Text, txtSubject.Text, txtBody.Text)
  36.             Catch err As Exception
  37.                 MsgBox(err.Message)
  38.             End Try
  39.             Threading.Thread.Sleep(numDuration.Value)
  40.         Loop
  41.     End Sub
  42.  
  43. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement