Chilkat HOME Android™ ASP Visual Basic VB.NET C# iOS (IPhone) Objective-C C++ C Unicode C++ Unicode C MFC Delphi DLL Delphi ActiveX FoxPro Java Perl PHP Extension PHP ActiveX Python PowerShell Ruby SQL Server VBScript
(VBScript) Connecting to GMAIL using IMAPDemonstrates how to connect to GMAIL using IMAP.
Dim fso, outFile Set fso = CreateObject("Scripting.FileSystemObject") Set outFile = fso.CreateTextFile("output.txt", True) set imap = CreateObject("Chilkat.Imap") ' Anything unlocks the component and begins a fully-functional 30-day trial. success = imap.UnlockComponent("Anything for 30-day trial") If (success <> 1) Then outFile.WriteLine(imap.LastErrorText) WScript.Quit End If ' Turn on session logging: imap.KeepSessionLog = 1 ' Connect to GMail ' Chilkat automatically recognizes "imap.gmail.com" and, ' because it's so common, automatically sets the port = 993 ' and uses a secure SSL/TLS connection. success = imap.Connect("imap.gmail.com") If (success <> 1) Then outFile.WriteLine(imap.LastErrorText) WScript.Quit End If ' Login ' Your login is typically your GMail email address. success = imap.Login("username@gmail.com","myPassword") If (success <> 1) Then outFile.WriteLine(imap.LastErrorText) WScript.Quit End If ' Select an IMAP mailbox success = imap.SelectMailbox("Inbox") If (success <> 1) Then outFile.WriteLine(imap.LastErrorText) WScript.Quit End If ' Show the session log. outFile.WriteLine(imap.SessionLog) ' Disconnect from the IMAP server. imap.Disconnect outFile.Close |
© 2000-2013 Chilkat Software, Inc. All Rights Reserved.