+ Reply to Thread
Results 1 to 7 of 7

Thread: How to make a Email Client/Sender

  1. #1
    haxftw is offline Newbie
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

    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. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    giv3mesmile's Avatar
    giv3mesmile is offline Newbie
    Join Date
    Jan 2010
    Location
    Europe>Balkan>Serbia>Belgrade
    Posts
    14
    Rep Power
    0

    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.

  4. #3
    Join Date
    Jul 2006
    Posts
    16,478
    Blog Entries
    75
    Rep Power
    143

    Re: How to make a Email Client/Sender

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

  5. #4
    giv3mesmile's Avatar
    giv3mesmile is offline Newbie
    Join Date
    Jan 2010
    Location
    Europe>Balkan>Serbia>Belgrade
    Posts
    14
    Rep Power
    0

    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

  6. #5
    Bioshox is offline Programmer
    Join Date
    Oct 2009
    Location
    Manchester, UK
    Posts
    196
    Rep Power
    10

    Re: How to make a Email Client/Sender

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

  7. #6
    D0m1313 is offline Newbie
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Re: How to make a Email Client/Sender

    Haha im trying this right now!

  8. #7
    D0m1313 is offline Newbie
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    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. Replies: 18
    Last Post: 11-04-2011, 06:20 PM
  2. Replies: 2
    Last Post: 08-14-2011, 03:00 PM
  3. Massive Email Client
    By dargueta in forum Bash / Shell Scripting
    Replies: 1
    Last Post: 07-04-2010, 12:02 PM
  4. VB Email Sender
    By VBnet in forum Visual Basic Tutorials
    Replies: 1
    Last Post: 04-27-2010, 05:58 AM
  5. Open Default Email Client with Attachment
    By brownhead in forum C# Programming
    Replies: 3
    Last Post: 07-07-2009, 01:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

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