Thread Rating:
  • 3 Vote(s) - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Visual Basic] Send An Email [Tutorial]
#1
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.

Step Two | Code Your Buttons

-First, double click on your 'Send Email' button. At the top, above 'Public Class Form1' type in this code...
Code:
Imports System.Net.Mail
-Next, its time to code the button we double clicked on. Just Copy and Paste this...
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.

[Image: iddyEs.png]
Reply


Messages In This Thread
[Visual Basic] Send An Email [Tutorial] - by Coding Support - 06-23-2011, 07:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How To make an advanced Operating System in Visual Basic 2010 ? Mohamed Samir 9 12,442 01-15-2013, 09:30 PM
Last Post: Resistance
  [TuToRiAl] How to make Offline (No Internet) Captcha (Human Confirmation) [TuToRiAl] Resistance 24 12,527 08-30-2012, 10:14 PM
Last Post: Resistance
  [Visual Basic] FTP Uploader [Tutorial] Coding Support 6 3,007 08-12-2012, 12:36 AM
Last Post: Kenneth
  Visual Studio Bill Nye The Science Guy 1 1,028 03-19-2012, 09:08 AM
Last Post: BreShiE
  Visual Basic Guide - Buttons Death Demise 9 5,296 03-09-2012, 06:46 PM
Last Post: BreShiE

Forum Jump:


Users browsing this thread: 4 Guest(s)