locked
downloading attachment from e-mail. RRS feed

  • Question

  • Hi,

    i want to download attachment from pop3 server, and store it in a local directory.

     

    With Regards

    Bikram

     


    litu Here
    Monday, November 14, 2011 6:31 PM

Answers

  • I'm not sure why you are posting a C# email problem on an Excel forum.  The visual Studio Net Library gives you many more options than the Microsoft Office VBA library.

    Doing a google Search for "c# pop email" will give you lots of results.  You can also Open an Outlook Application from C# like in Ron Debruins code using the Visual Studio Office API library.  It is not that difficult to convert Ron's code from VBA to C#.  I can help if you decide to take that approach.

    I would recommend if you already have Outlook connected to a POP account to use Outlook approach.  Normally when you have Outlook connected to a POP account the mail in the POP account is automatically deleted after it is downloaded into Outlook.  So you may not find all the emails in the POP account.

    Another issue is when you try to read email through outlook a security warning message comes up that only allow you to access the account for a limited number of minutes.  So you can't automaticaly retrieve emails without a user clicking on a GUI for the software to run.

    My preference is to create an action in Outlook which automatically stores the incoming attachments into a folder on a PC using an Outlook Macro.  This avoids the security warning issue.  Then your C# code only has to open files on the PC.

     

     


    jdweng
    • Marked as answer by Calvin_Gao Friday, November 25, 2011 9:54 AM
    Tuesday, November 15, 2011 4:18 AM

All replies

  • Bikram:

    Did you want to do this from Excel?  If so, what version of Excel and Windows.

    Regards,


    Rich Locus, Logicwurks, LLC

    http://www.logicwurks.com

    Monday, November 14, 2011 8:53 PM
  • Are you using Outlook on your PC?  You can open an Outlook Application from Excel VBA to get the emails..
    jdweng
    Monday, November 14, 2011 8:57 PM
  • See also this thread, only works using Outlook:

    http://www.rondebruin.nl/mail/folder2/saveatt.htm


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    Monday, November 14, 2011 10:22 PM
  • Hi,

     

    I want to download an email attachment from pop3 using C# 


    litu Here
    Tuesday, November 15, 2011 3:56 AM
  • I'm not sure why you are posting a C# email problem on an Excel forum.  The visual Studio Net Library gives you many more options than the Microsoft Office VBA library.

    Doing a google Search for "c# pop email" will give you lots of results.  You can also Open an Outlook Application from C# like in Ron Debruins code using the Visual Studio Office API library.  It is not that difficult to convert Ron's code from VBA to C#.  I can help if you decide to take that approach.

    I would recommend if you already have Outlook connected to a POP account to use Outlook approach.  Normally when you have Outlook connected to a POP account the mail in the POP account is automatically deleted after it is downloaded into Outlook.  So you may not find all the emails in the POP account.

    Another issue is when you try to read email through outlook a security warning message comes up that only allow you to access the account for a limited number of minutes.  So you can't automaticaly retrieve emails without a user clicking on a GUI for the software to run.

    My preference is to create an action in Outlook which automatically stores the incoming attachments into a folder on a PC using an Outlook Macro.  This avoids the security warning issue.  Then your C# code only has to open files on the PC.

     

     


    jdweng
    • Marked as answer by Calvin_Gao Friday, November 25, 2011 9:54 AM
    Tuesday, November 15, 2011 4:18 AM