Perl Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Perl Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
SMTP
Socket / SSL
Spider
SFTP
SSH Key
SSH
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

(Perl) Connecting to GMAIL using IMAP

Demonstrates how to connect to GMAIL using IMAP.

 Chilkat Perl Module Downloads for Windows, Linux, and MAC OS X

use chilkat();


$imap = new chilkat::CkImap();

#  Anything unlocks the component and begins a fully-functional 30-day trial.
$success = $imap->UnlockComponent("Anything for 30-day trial");
if ($success != 1) {
    print $imap->lastErrorText() . "\r\n";
    exit;
}

#  Turn on session logging:
$imap->put_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) {
    print $imap->lastErrorText() . "\r\n";
    exit;
}

#  Login
#  Your login is typically your GMail email address.
$success = $imap->Login('username@gmail.com',"myPassword");
if ($success != 1) {
    print $imap->lastErrorText() . "\r\n";
    exit;
}

#  Select an IMAP mailbox
$success = $imap->SelectMailbox("Inbox");
if ($success != 1) {
    print $imap->lastErrorText() . "\r\n";
    exit;
}

#  Show the session log.
print $imap->sessionLog() . "\r\n";

#  Disconnect from the IMAP server.
$imap->Disconnect();


 

© 2000-2013 Chilkat Software, Inc. All Rights Reserved.