Pop3 to SMTP message custom forwarder in C#

戏子无情 提交于 2019-11-30 10:25:34
f3lix

The following SO questions/answers might help finding components for the POP3 part of your porject:

And you can use SmtpClient in System.Net.Mail for sending the mails:

I implemented something very similar using MailBee's IMAP, POP and SMTP .NET components.

They're not free, I'm afraid, but I've found them to be pretty solid, and AfterLogic's support is fast.

There's also the free (including source code) LumiSoft Mail Server, that has POP3 relay support to collect messages from a POP3 server and manage them from there, you could adapt that? (It's written in C#, is nice to work with and upgrades cleanly to VS2008). I've had no problems with that either.

Try Mail.dll .NET email component. It has SSL support, POP3 and SMTP clients.

using(Pop3 pop3 = new Pop3())
{
    pop3.Connect("mail.host.com");    // Connect to the server 
    pop3.Login("user", "password");

    foreach(string uid in pop3.GetAll())
    {
        // Receive mail
        IMail mail = new MailBuilder()
   .CreateFromEml(pop3.GetMessageByUID(uid));
        Console.WriteLine(mail.Subject);
    }
    pop3.Close(true); 
}

You can download it here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!