如何在Windows应用程序中使用C#从邮件正文(外观)中自动打开(单击)HTTP链接?

时间:2018-12-07 12:49:32

标签: c# outlook-2010 pop3

我想自动打开或单击 Outlook 邮件正文中的http链接。

我正在使用 MailServer
这是我的代码:

// Some function...     
    for (int i = 0; i < infos.Length; i++)
    {
        MailInfo info = infos[i];
        Console.WriteLine("Index: {0}; Size: {1}; UIDL: {2}; Flags: {3}",
            info.Index, info.Size, info.UIDL, info.Flags);

        // Receive email from POP3 server
        Mail oMail = oClient.GetMail(info);

        Console.WriteLine("From: {0}", oMail.From.ToString());
        Console.WriteLine("To: {0}", oMail.To.ToString());
        Console.WriteLine("Subject: {0}\r\n", oMail.Subject);
        if (oMail.Attachments.Length > 0)
        {
            for (int j = 0; j <= oMail.Attachments.Length - 1; j++)
            {
                System.DateTime d = System.DateTime.Now;
                System.Globalization.CultureInfo cur = new System.Globalization.CultureInfo("en-US");
                string sdate = d.ToString("MMddyyyyHHmmss", cur);
                string fileName = String.Format("{0}\\{1}{2}{3}.eml", mailbox, sdate, d.Millisecond.ToString("d3"), i);
                // Save email to local disk
                oMail.SaveAs(fileName, true);
                // Save attachments in specific folders.
                oMail.Attachments[j].SaveAs(@"D:\"{Folder Name}"\" + oMail.Attachments[j].Name, true);  // find the said path
                // Mark email as deleted from POP3 server.
                oClient.Delete(info);
            }
        }
        // Generate an email file name based on date time.
    }
    // Quit and purge emails marked as deleted from POP3 server.
    oClient.Quit();
}

请给我任何想法。

0 个答案:

没有答案