Hi,
Please take a look at those 2 articles:
The code looks more or less like this:
IMail original = GetFirstMessage();
ForwardBuilder forwardBuilder = original.Forward();
forwardBuilder.Html = "Tom, <br/><br/>please resolve this.";
MailBuilder builder = forwardBuilder.Forward(
new MailBox("bob@example.org", "Bob"));
builder.To.Add(
new MailBox("tom@example.org", "Tom"));
// You can add attachments to forwarded email
//builder.AddAttachment("report.csv");
IMail forward = builder.Create();
using (Smtp smtp = new Smtp())
{
smtp.Connect("smtp.example.org"); // or ConnectSSL
smtp.UseBestLogin("user", "password");
smtp.SendMessage(forward);
smtp.Close();
}
static IMail GetFirstMessage()
{
IMail email;
using (Imap imap = new Imap())
{
imap.Connect("imap.example.com"); // or ConnectSSL
imap.UseBestLogin("user", "password");
List<long> uids = imap.GetAll();
if (uids.Count == 0)
throw new Exception("There are no messages");
var eml = imap.GetMessageByUID(uids[0]);
email = new MailBuilder().CreateFromEml(eml);
imap.Close();
}
return email;
}