Imports System.Net.Mail Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim objRandom As New System.Random(CType(System.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer)) Dim Random1 As String Dim Random2 As String Dim Random3 As String Dim Random4 As String Dim Random5 As String Random1 = objRandom.Next(100, 999) Random2 = objRandom.Next(1000, 9999) Random3 = objRandom.Next(1000, 9999) Random4 = objRandom.Next(1000, 9999) Random5 = objRandom.Next(1000, 9999) TEXBOX1.Text = "Code" + Random1 End Sub Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click MsgBox("Yaz's Employee Verification Build 1.0") End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Close() End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Dim MyMailMessage As New MailMessage() Try MyMailMessage.From = New MailAddress(" norply@norply.com ") MyMailMessage.To.Add(TEXBOX1.Text) MyMailMessage.Subject = "Subject here" MyMailMessage.Body = "Body of message goes here" Dim SMTP As New SmtpClient("smtp.gmail.com") SMTP.Port = 587 SMTP.EnableSsl = True SMTP.Credentials = New System.Net.NetworkCredential("Your E-Mail", "your Password") SMTP.Send(MyMailMessage) MsgBox("Email has been sent!", MsgBoxStyle.Information, "Serial Code") Me.Close() Catch ex As Exception End Try End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)