Ahoj, jsem totální amatér všech amatéru v programování, ale rád se odrážím od video tutoriálů na webu. Nyní programuji aplikaci ve VisualStudiu (VisualBasic - WindowsForm), dnes jsem přidával emailový feedback podle tohoto videa:
vlákno:
Imports System.Net.Mail
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim MyMessage As New MailMessage
Try
MyMessage.From = New MailAddress(-example@gmail.com-)
MyMessage.To.Add(-example@gmail.com-)
MyMessage.Subject = TextBox3.Text
MyMessage.Body = TextBox1.Text
Dim SMTP As New SmtpClient(-smtp.gmail.com-)
SMTP.Port = 587
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential(-example@gmail.com-, -email password-)
SMTP.Send(MyMessage)
Catch ex As Exception
Me.Hide()
Form2.Show()
End Try
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Dim ask As MsgBoxResult
ask = MsgBox(-Are you sure you want to clear out your form?-, MsgBoxStyle.YesNoCancel, -Clearing The Form-)
If ask = MsgBoxResult.Yes Then
MsgBox(-You have decided to clear the form.-)
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
ElseIf ask = MsgBoxResult.No Then
MsgBox(-You have decided to cancel.-)
End If
End Sub
End Class