SMTP: Save Sent Message to Sent Folder


By default, messages sent with the SMTP component are not saved on the mail server. To maintain a record of sent messages, use the IMAP component to append a copy of the message to the Sent Items folder by following this approach:

First, combine the headers and body of the message as follows:

String myMessage = smtp.MessageHeaders + "\r\n\r\n" + smtp.MessageText;

Then, using the IMAP component you would do:

imap.MesageText = myMessage;
imap.Mailbox = "SENT";
imap.AppendToMailbox();

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.