+ Reply to Thread
Results 1 to 4 of 4

Thread: Send Email Via SMTP

  1. #1
    Newbie VBnet is on a distinguished road VBnet's Avatar
    Join Date
    May 2009
    Location
    Sweden :D
    Posts
    18

    Send Email Via SMTP

    Hello CodeCall, I will be showing you how to send emails with VB

    You will need:
    2 Buttons
    and 1 Textbox (2 optional if you want to make a login, error reporter)


    Place 1 first Textbox on the form.

    Then after resizing the textbox, add a button, change it to "Send Email" and add:
    Code:
    Code:
    Dim smtpServer As New SmtpClient()
            Dim mail As New MailMessage()
            smtpServer.Credentials = New Net.NetworkCredential("fertyl5@gmail.com", "fertyl200")
            'using gmail
            smtpServer.Port = 587
            smtpServer.Host = "smtp.gmail.com"
            smtpServer.EnableSsl = True
            mail = New MailMessage()
            mail.From = New MailAddress("fertyl5@gmail.com")
            mail.To.Add("admin@gamerschannel.net")
            mail.Subject = ComboBox1.SelectedItem.ToString
            mail.Body = TextBox1.Text
            smtpServer.Send(mail)
            MsgBox("Mail Sent Succesfull!")
    Everything that ive marked with red, those you need to change! if marked with green you dont need, only optional.

    Then take this:
    Code:
    Code:
    imports system.net.Mail
    and put it over "Public Class Form1"

    and you are done!

    Debug the program and test it out, and remember the mail goes to the mail entered "mail.To.Add("Youremailhere@gmail.com")"

    AND BTW! IT HAS TO BE GMAIL AS SMTP

    and now you are done!

    Dont forget to be nice to me when writing back , Bye Bye!!

  2. #2
    Moderator Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe's Avatar
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Age
    17
    Posts
    9,407
    Blog Entries
    5

    Re: Send Email Via SMTP

    do you call this much better than mine? You don't even check if the addresses exists, and what if the mail wasn't sent "Succesfull!"?

  3. #3
    Newbie Heagu is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    11

    Re: Send Email Via SMTP

    Yeah , thats awesome , tried it with some friends you can send some cool messages to make them frightened

  4. #4
    Newbie giv3mesmile is an unknown quantity at this point giv3mesmile's Avatar
    Join Date
    Jan 2010
    Location
    Europe>Balkan>Serbia>Belgrade
    Posts
    14

    Re: Send Email Via SMTP

    Any way i could use this in VB6.0 not .Net version.?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Create your own email list!
    By BlaineSch in forum PHP Tutorials
    Replies: 3
    Last Post: 05-02-2009, 08:19 PM
  2. Send email attachment
    By cakka in forum PHP Forum
    Replies: 2
    Last Post: 03-25-2009, 12:47 AM
  3. SSH Command send email attachment
    By cakka in forum Hosting and Registrars
    Replies: 3
    Last Post: 02-02-2009, 10:53 AM
  4. Replies: 2
    Last Post: 04-18-2008, 04:09 AM
  5. send email >>>>>but!!!!
    By kiss in forum Visual Basic Programming
    Replies: 7
    Last Post: 01-10-2008, 05:44 AM