Advertising

review www.do11warnet.blogspot.com on alexa.com

Thursday, January 26, 2012

Make Email Sender

Tools:
  • Microsoft Visual Basic 2008
  • Internet Conection
Create a new project in VB 2008
1 Form 1 Form Login
Settings in your Project
Copy Paste this code on the OK button in the login form

Code

If txtPassword.Text <> "" Then
msgConf = MsgBox("Anda Yakin sudah memasukan ID & Password dengan benar?", MsgBoxStyle.YesNo, "Konfirmasi")
Select Case msgConf
Case vbYes
Form1.Show()
Me.Hide()



Then add three text boxes and a Button like this

Copy Paste this code on the button the Main Form (Form1)

Code

MailFrom.From = New MailAddress(Login1.txtEmail.Text) MailFrom.To.Add(txtRecv.Text) MailFrom.Body = txtPesan.Text MailFrom.Subject = txtJudul.Text 'SMTP SMTP.EnableSsl = True SMTP.Port = "587" SMTP.Host = "smtp.gmail.com" SMTP.Credentials = New Net.NetworkCredential(Login1.txtEmail.Text, Login1.txtPassword.Text) SMTP.Send(MailFrom) MsgBox("Mail Sended ^^")




Paste this code at the top

Code

Imports System.Net.Mail Public Class Form1 Dim MailFrom As New MailMessage Dim SMTP As New SmtpClient






Compile

No comments:

Post a Comment

Your Comment