Results 1 to 7 of 7

Thread: Getting Email from GMail

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    20

    Getting Email from GMail

    I want to make an App that will get my unread emails from gmail, then send them out to my cell phone.

    I am not too sure on how to do the networking parts of this program, any suggestions to start?

    I know I would have to connect to the IP of gmail, but I don't know how to handle the login part.

  2. #2
    Lively Member
    Join Date
    Apr 2010
    Location
    York, Uk
    Posts
    103

    Re: Getting Email from GMail

    Gmail does this anyway...
    however.. If your serious there are several precompiled DLL's you can call in your code to connect to and handle POP3 mail downloads. I'm not sure how you would "send the data" to your "cell-Phone" but there are several companies that allow you to "feed" them data into the SMS API and it will send to your phone however this will cost..


    This may help?


    http://www.a1vbcode.com/snippet-3383.asp

  3. #3
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Getting Email from GMail

    I had to do the same thing a while ago. There's loads of POP3 clients available that allow you to read email, but almost none use SSL (some kind of secure connection), and gmail requires SSL.

    This one does use SSL:
    http://csharpmail.codeplex.com/releases/view/41762

    It worked, but I haven't played with it alot and there were some strange things in regards to how many emails were returned. Sometimes it was 350 emails, sometimes only 10. It seems it only returns 'unread' emails, but I'm not sure what determines whether an email is 'unread' (because I read those 10 emails in the webbrowser gmail client already)...

    If you downloaded the DLL you can just reference it in your project. If you downloaded the source then you need to add that project to your solution, and reference the project instead.

    You'd then use kind like this to get the emails
    vb.net Code:
    1. Using client As New Pop3Client()
    2.    client.UserName = "[email protected]"
    3.    client.Password = "your password"
    4.    client.ServerName = "pop.gmail.com"
    5.    client.Port = 995
    6.    client.Ssl = True
    7.  
    8.    client.Authenticate()
    9.  
    10.    For i As Integer = 1 To client.GetTotalMessageCount()
    11.       Dim msg As Pop3Message = client.GetMessage(i)
    12.       MessageBox.Show(msg.From)
    13.       MessageBox.Show(msg.BodyText)
    14.       MessageBox.Show(msg.Date.ToString)
    15.    Next
    16. End Using
    That's how I used it anyway, but as I said I never played with it much, so there might be something wrong with that.

    As for sending them to your phone, do you mean send them as emails? .NET has a built in email client (which can only send, not read) so perhaps you could use that.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    20

    Re: Getting Email from GMail

    Okay I see where you're going with POP3 code. and I was thinking of sending the emails to my phone either by fowarding the messages to my phones email on the ATT networks, or through AIM chat client.

  5. #5
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Getting Email from GMail

    The actual problem is attachments in a mail.
    I was making my own program but i had to stop it and move to ASP pronto, but the most probable problem would be attachments if you decide to have them.
    Am amazed Microsoft neglects that.
    Also if you have office installed then have a look http://msdn.microsoft.com/en-us/libr...8VS.80%29.aspx

    I've used the first version on the old CF for mobile and of course was a total BS but maybe they have fixed it since then
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    20

    Re: Getting Email from GMail

    Well the reason I am trying to develop this app is to not have to pay for internet on my mobile (just yet)....But I am going to start planning it out tomorrow most likely. I'll probably need help so I'll be sure to post.

  7. #7
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Getting Email from GMail

    If you don't want to pay , you can also find a free Wifi hotspot.
    That's what i currently do.....You will need net somewhere in time as you say, so your app would probably be as a "know how" project i guess..
    Ah and is 100% LEGIT ( )
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

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



Click Here to Expand Forum to Full Width