Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

New Post: Create a message after being Sent

$
0
0
Hi gvaldesmcl,

to save a System.Net.MailMessage to the sent folder you can use the following code:
// Create and send a message using System.Net.Mail
var mailMessage = new System.Net.Mail.MailMessage();
// ... send logic here ..

// Creating an ImapClient
var client = new ImapClient("imap.gmail.com", true);

// Connecting
if(client.Connect())
{

         // Authenticating
         if(client.Login("name@gmail.com", "password"))
         {

                  // Saving the System.Net.Mail.MailMessage directly to Sent folder:
                  client.Folders.Sent.AppendMessage(mailMessage);

         }

}
Hope this helps,

Best regards,

Pavel

Viewing all articles
Browse latest Browse all 1952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>