Not logged in [
Login
-
Register
]
You Are Not Registered Or Not Logged In
Corsa Sport
»
Message Board
»
Off Day
»
Geek Day
»
Software valuation
» Post Reply
Post Reply
Who Can Post?
All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Tahoma
Times New Roman
Trebuchet MS
Script MT Bold
Stencil
Verdana
Lucida Console
-2
-1
1
2
3
4
5
6
White
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
[quote][i]Originally posted by Chris[/i] Imports System.IO Imports EAGetMail 'imports EAGetMail namespace Module Module1 Sub Main() ' Create a folder named "inbox" under current directory ' to save the email retrieved. Dim curpath As String = Directory.GetCurrentDirectory() Dim mailbox As String = [String].Format("{0}\inbox", curpath) ' If the folder is not existed, create it. If Not Directory.Exists(mailbox) Then Directory.CreateDirectory(mailbox) End If ' Gmail IMAP server is "imap.gmail.com" Dim oServer As New MailServer("imap.gmail.com", _ "gmailid@gmail.com", "yourpassword", ServerProtocol.Imap4 ) Dim oClient As New MailClient("TryIt") ' Enable SSL connection oServer.SSLConnection = True ' Set IMAP4 SSL port oServer.Port = 993 Try oClient.Connect(oServer) Dim infos As MailInfo() = oClient.GetMailInfos() For i As Integer = 0 To infos.Length - 1 Dim info As MailInfo = infos(i) Console.WriteLine("Index: {0}; Size: {1}; UIDL: {2}", _ info.Index, info.Size, info.UIDL) ' Receive email from Gmail server Dim oMail As Mail = oClient.GetMail(info) Console.WriteLine("From: {0}", oMail.From.ToString()) Console.WriteLine("Subject: {0}" & vbCr & vbLf, oMail.Subject) ' Generate an email file name based on date time. Dim d As System.DateTime = System.DateTime.Now Dim cur As New System.Globalization.CultureInfo("en-US") Dim sdate As String = d.ToString("yyyyMMddHHmmss", cur) Dim fileName As String = [String].Format("{0}\{1}{2}{3}.eml", _ mailbox, sdate, d.Millisecond.ToString("d3"), i) ' Save email to local disk oMail.SaveAs(fileName, True) ' Mark email as deleted in Gmail Account oClient.Delete(info) Next ' Quit and pure emails marked as deleted from Gmail IMAP4 server. oClient.Quit() Catch ep As Exception Console.WriteLine(ep.Message) End Try End Sub End Module [/quote]
Post Options:
Disable smileys?
Turn BBCode off?
Receive email notification of new replies?
This is a long topic, click
here
to review it.