Imports System.Net.Mail
Public Class frmMail
Private Sub cmdSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSend.Click
If txtMail.Text = Nothing Or txtMsg.Text = Nothing Then
MessageBox.Show("Riempire tutti i campi necessari!", "Error #8", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Exit Sub
End If
If txtName.Text = Nothing Then
txtName.Text = "Anonimo"
End If
Try
Dim Mail As New MailMessage
Dim Client As New Net.Mail.SmtpClient
Mail.From = New MailAddress(txtMail.Text)
Mail.IsBodyHtml = False
Mail.Body = txtMsg.Text
Mail.ReplyTo = New MailAddress(txtMail.Text)
Mail.Sender = New MailAddress(txtMail.Text)
Mail.Subject = "The Agent, Bug Report: da parte di " + txtName.Text
Mail.To.Add("nicolo1990@yahoo.it")
Client.Host = "mail.tin.it"
Client.Send(Mail)
MessageBox.Show("Hai appena inviato un'e-mail. Al più presto riceverai una risposta!", "Mail inviata", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch FE As FormatException
MessageBox.Show("Inserisci un indirizzo e-mail valido!", "Error #9", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Try
End Sub
'L'agente esegue una lagna terribile credendo di essere malato (:P)
Private Sub frmMail_Shown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
With frmHelper.Agente
If frmHelper.Options.Tragedy_On Then
.Play("Confused")
.Speak("Cosa?")
.Speak("Hai trovato un baco? \Pau=500\ Sono malato?")
.Play("Sad")
.Speak("No, non ci posso credere! Sono troppo giovane per morire!")
.Speak("Tu, aiutami! Abbi un po' di pietà per me, non lasciarmi in balìa delle formiche!")
.Speak("Dopotutto, non ti ho fatto niente di male! \Pau=300\ Che cuore hai? Di pietra, te lo dico io!")
.Speak("Per te sono solo un ammasso di bit e niente altro? Beh, ciccino, ti sbagli!")
.Hide()
System.Threading.Thread.Sleep(3000)
.Show()
.Play("Uncertain")
.Speak("Dai, non arrabbiarti, non dicevo sul serio! Curami! Curami! Curamiii!")
End If
End With
End Sub
End Class