Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Send IMAP Raw Command and Receive ResponseDemonstrates how to send an arbitrary (raw) command to an IMAP server and receive the response. This example will set the "Seen" flag for an email with a pre-known UID. Note: Normally, you would call the SetFlag method to set a flag. This example only serves to show how SendRawCommand is used. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% set imap = Server.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 Response.Write "<pre>" & Server.HTMLEncode(imap.LastErrorText) & "</pre>" End If imap.KeepSessionLog = 1 ' Connect to an IMAP server. success = imap.Connect("mail.chilkatsoft.com") If (success <> 1) Then Response.Write "<pre>" & Server.HTMLEncode(imap.LastErrorText) & "</pre>" End If ' Login success = imap.Login("***","***") If (success <> 1) Then Response.Write "<pre>" & Server.HTMLEncode(imap.LastErrorText) & "</pre>" End If ' Select an IMAP mailbox success = imap.SelectMailbox("Inbox") If (success <> 1) Then Response.Write "<pre>" & Server.HTMLEncode(imap.LastErrorText) & "</pre>" End If ' Assume we know that the UID for the email in question is 2: response = imap.SendRawCommand("UID STORE 2 +FLAGS.SILENT (\Seen)") Response.Write "<pre>" & Server.HTMLEncode( response) & "</pre>" ' Disconnect from the IMAP server. imap.Disconnect Response.Write "<pre>" & Server.HTMLEncode( imap.SessionLog) & "</pre>" %> </body> </html> |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.