Questo sito utilizza cookies, anche di terze parti, per mostrare pubblicità e servizi in linea con il tuo account. Leggi l'informativa sui cookies.
Username: Password: oppure
Emailer Anonimo - Form1.vb

Form1.vb

Caricato da:
Scarica il programma completo

  1. Public Class Form1
  2.     Dim path As String
  3.  
  4.  
  5.     Public Sub cmdinvia_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdinvia.Click
  6.         ToolStripStatusLabel2.Text = ""
  7.         Try
  8.             Dim Msg As New System.Net.Mail.MailMessage(txtmitt.Text, txtdest.Text, txtogg.Text, txtcorpo.Text)
  9.             Dim Smtp As New System.Net.Mail.SmtpClient(txtsmtp.Text)
  10.             If path <> "nada" Then
  11.                 ToolStripStatusLabel2.Text = "Allego L'allegato xD"
  12.                 Msg.Attachments.Add(New Net.Mail.Attachment(path))
  13.             End If
  14.             Smtp.Send(Msg)
  15.             ToolStripStatusLabel2.Text = "Inviato!"
  16.         Catch ex As Exception
  17.             ToolStripStatusLabel2.Text = "Errore! Non inviato!"
  18.         End Try
  19.     End Sub
  20.  
  21.     Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  22.         OpenFileDialog1.ShowDialog()
  23.         path = OpenFileDialog1.FileName
  24.         Label6.Text = OpenFileDialog1.SafeFileName
  25.     End Sub
  26.  
  27.     Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
  28.         MsgBox("Creato da Sub0! Per pierotofy.it", MsgBoxStyle.OkOnly, "EXIT")
  29.     End Sub
  30.  
  31.     Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  32.         path = "nada"
  33.     End Sub
  34.  
  35.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  36.         path = "nada"
  37.         Label6.Text = "Allega un file..."
  38.     End Sub
  39. End Class