Support Forums

Full Version: [Visual Basic] Send An Email [Tutorial]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.

We already have many of these basic type tutorials in SF. Creating more just depletes their importance, Dope. Though you do have an attractive tutorial set up, thanks for your contribution!
(06-23-2011, 10:26 PM)Resistance Wrote: [ -> ]We already have many of these basic type tutorials in SF. Creating more just depletes their importance, Dope. Though you do have an attractive tutorial set up, thanks for your contribution!
I am sure mine is one of the most easy to follow. Anyways, thanks for the thanks.. lol

your welcome.

good tutorial, hope it will help out some people who are new to vb. Keep it up
Good job, you should figure out how to use multiple websites.
(06-24-2011, 07:45 PM)Slurms Makenzi Wrote: [ -> ]Good job, you should figure out how to use multiple websites.

All you need to do is change the SMPT/Port to your email's.
I already knew this, but it's still an interesting tutorial.

Thanks.
This is very unsecure as the application can be decompiled and the raw code can be used. It is a lot better to create a PHP script with simple Base64 encryption that allows the application to Base64 hash the credentials and use a HTTP WebRequest POST script to post the encrypted Base64.

Anyways, thanks for posting.
(06-25-2011, 12:41 AM)Blic Wrote: [ -> ]This is very unsecure as the application can be decompiled and the raw code can be used. It is a lot better to create a PHP script with simple Base64 encryption that allows the application to Base64 hash the credentials and use a HTTP WebRequest POST script to post the encrypted Base64.

Anyways, thanks for posting.
no one said that it was secureNonNon
This is what people use to make phishing programs.

Thanks for this though!