Hi gvaldesmcl,
to save a System.Net.MailMessage to the sent folder you can use the following code:
Best regards,
Pavel
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