06-23-2011, 07:49 PM
Sending an Email Tutorial
Step One | Design Your Program
-Design your program the way you want it, or you can make it look just like mine. It doesn't matter as long as you have all of the same things i have, such as the same amount of textboxes, ect...
-Here is a picture of my form, it was made quickly.
-Here is a picture of my form, it was made quickly.
Spoiler (Click to View)
Step Two | Code Your Buttons
-First, double click on your 'Send Email' button. At the top, above 'Public Class Form1' type in this code...
-Next, its time to code the button we double clicked on. Just Copy and Paste this...
Code:
Imports System.Net.Mail
Code:
Dim MailMessage As New MailMessage()
MailMessage.From = New MailAddress(TextBox1.Text)
MailMessage.To.Add(TextBox3.Text)
MailMessage.Subject = (TextBox4.Text)
MailMessage.Body = TextBox5.Text
Dim SMTPServer As New SmtpClient("smtp.gmail.com")
SMTPServer.Port = 587
SMTPServer.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
SMTPServer.EnableSsl = True
SMTPServer.Send(MailMessage)
Step Three | Debug and Test
-Debug it and test it, you can send an email to yourself if you want. This can be Easily modified to become an Email Bomber, but that is not the point of this tutorial.