Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Upload (Append) Email to an IMAP MailboxUpload / append an email to an IMAP mailbox.
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, CHILKATMAILLib2_TLB, CHILKATIMAPLib_TLB, OleCtrls; ... procedure TForm1.Button1Click(Sender: TObject); var imap: TChilkatImap; success: Integer; email: CHILKATMAILLib2_TLB.IChilkatEmail2; begin imap := TChilkatImap.Create(Self); // Anything unlocks the component and begins a fully-functional 30-day trial. success := imap.UnlockComponent('Anything for 30-day trial'); if (success <> 1) then begin ShowMessage(imap.LastErrorText); Exit; end; // Connect to an IMAP server. success := imap.Connect('mail.chilkatsoft.com'); if (success <> 1) then begin ShowMessage(imap.LastErrorText); Exit; end; // Login success := imap.Login('myLogin','myPassword'); if (success <> 1) then begin ShowMessage(imap.LastErrorText); Exit; end; email := CoChilkatEmail2.Create(); // Load the email from a .eml file. success := email.LoadEml('myEmail.eml'); if (success <> 1) then begin ShowMessage(email.LastErrorText); Exit; end; success := imap.AppendMail('Inbox',email As CHILKATIMAPLib_TLB.IChilkatEmail2); if (success <> 1) then begin ShowMessage(imap.LastErrorText); Exit; end; Memo1.Lines.Add('Email uploaded to Inbox!'); // Disconnect from the IMAP server. imap.Disconnect(); end; |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.