+ Reply to Thread
Results 1 to 7 of 7

Thread: How to make a Email Client/Sender

  1. #1
    Newbie haxftw is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    2

    Smile How to make a Email Client/Sender

    Hello, Today i will be showing you how to create a email sender!
    Its really simple, and then i mean.. simple


    Start by Creating a new Window Forms Application

    When you have done that, you will have a blank form, Double click the form so the coding page shows and add the folowing code over Public Class Form1

    Code:
    Imports System.Net.Mail
    When you have done that and you have no errors, continue.


    Okey, so we will need 4 textboxes and 4 labels + one button

    Lets start with the first one!

    Add one Textbox and a Label, rename the label to "From" and place the textbox right after it

    then take the second textbox and the second label, rename it to "To" and place the textbox right after the label.

    Now place the third textbox and the third label, rename it to "Subject"

    Now at last, place the fourth textbox and the fourth label, rename the label to "Text" or "Enter message here". Make the fourth textbox multi line

    Now just add one button, change the text to "Send"

    Here Starts coding----------------------------------

    Okey, double click the button and add the folowing code:

    Code:
    Dim smtpServer As New SmtpClient()
            Dim mail As New MailMessage()
            smtpServer.Credentials = New Net.NetworkCredential("killerdwrf@gmail.com", "wertyl11")
            'using Gmail
            smtpServer.Port = 587
            smtpServer.Host = "smtp.gmail.com"
            smtpServer.EnableSsl = True
            mail = New MailMessage()
            mail.From = New MailAddress("killerdwrf@gmail.com" , textbox1.text)
            mail.To.Add(textbox2.text)
            mail.Subject = textbox3.text
            mail.Body = textbox4.text
            smtpServer.Send(mail)
    where it stands "("killerdwrf@gmail.com", "wertyl11")", you can ignore them, only change them if you dont wanna use my gmail account, remember this is not necessary!

    Coding ends here ----------------------------------

    Now debug your program, it you have any problems, please post them on the thread

    Please say thanks if this works!

    I am new here, and please ignore my spelling mistakes

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

    Re: How to make a Email Client/Sender

    uhm i have couple errors :S
    Error 1 Type 'SmtpClient' is not defined
    Error 2 Type 'MailMessage' is not defined.
    Error 4 Type 'MailAddress' is not defined.

  3. #3
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,668
    Blog Entries
    57

    Re: How to make a Email Client/Sender

    Did you include the import statement?
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  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: How to make a Email Client/Sender

    yeah :S
    Private Sub SendEmail(
    ByVal MailFrom As String, _
    ByVal MailPass As String, _
    ByVal MailTo As String, _
    ByVal MailSubj As String, _
    ByVal MailText As String, _
    ByVal MailFromName As String, _
    ByVal MailToName As String, _
    Optional ByVal MailAttach As String = "")
    now it cant complete it , can u see the mistake? something is missing im afraid

  5. #5
    Learning Programmer Bioshox is on a distinguished road
    Join Date
    Oct 2009
    Location
    Manchester, UK
    Posts
    88

    Re: How to make a Email Client/Sender

    I'll try this out when I get home!
    Thanks For This!

  6. #6
    Newbie D0m1313 is an unknown quantity at this point
    Join Date
    Feb 2010
    Posts
    3

    Re: How to make a Email Client/Sender

    Haha im trying this right now!

  7. #7
    Newbie D0m1313 is an unknown quantity at this point
    Join Date
    Feb 2010
    Posts
    3

    Re: How to make a Email Client/Sender

    how to send the information to the email?

+ 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. Send HTML email with Text Boxes
    By pu8y in forum Visual Basic Programming
    Replies: 5
    Last Post: 09-03-2009, 04:03 PM
  2. Replies: 18
    Last Post: 07-08-2009, 03:55 PM
  3. Create your own email list!
    By BlaineSch in forum PHP Tutorials
    Replies: 3
    Last Post: 05-02-2009, 11:19 PM
  4. Easy Email Validation
    By kresh7 in forum VB Tutorials
    Replies: 5
    Last Post: 01-19-2009, 10:07 AM
  5. How to make Dumplings
    By ahsan16 in forum The Lounge
    Replies: 2
    Last Post: 01-11-2007, 10:55 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts