This project is read-only.
1
Vote

Copy email

description

I want to get the email from email1 and then send the same email from email2 to email2. How to do that?
My code:
                var client = new ImapClient("imap.gmail.com", true);
                client.Login(textBox1.Text, textBox2.Text);
                var m = client.Folders.Inbox.Messages[0];
                client.Disconnect();
                client.Dispose();
                m.From = new ImapX.MailAddress("dd", textBox3.Text);
                m.To.Add(new ImapX.MailAddress("aaa", textBox3.Text));


                SmtpClient c = new SmtpClient("smtp.gmail.com", 587);
                c.EnableSsl = true;
                c.Credentials = new NetworkCredential(textBox3.Text, textBox4.Text);
                c.DeliveryMethod = SmtpDeliveryMethod.Network;
                //Error, convert ImapX.Message to System.Net.MailMessage
                c.Send(m);

comments