Storing a mail message on the IMAP server

procedure TForm1.btnStoreClick(Sender: TObject);
begin
   clIMAP4.Server := 'mail.test.com';
   clIMAP4.UserName := 'user';
   clIMAP4.Password := 'passw';
 
   clIMAP4.Open();
 
   clMailMessage1.BuildMessage('The message text follows here', '');
   clMailMessage1.From.FullAddress := 'test@test.com';
   clMailMessage1.ToList.EmailAddresses := 'support@mywebsite.com';
   clMailMessage1.Subject := 'Subject line';
 
   clIMAP4.AppendMessage('MyMailBox', clMailMessage1, [mfDraft]);
 
   clIMAP4.Close();  
end;

Add Feedback