Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# and attachments

C# and attachments

Scheduled Pinned Locked Moved C#
questioncsharpagentic-aihelp
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    annex45
    wrote on last edited by
    #1

    I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields.. question is, given a file path,how do i automate the process of attaching a file to that email and sending it? Scoured the web without finding a solution, So help will be greatly appreciated annex

    D B M J 4 Replies Last reply
    0
    • A annex45

      I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields.. question is, given a file path,how do i automate the process of attaching a file to that email and sending it? Scoured the web without finding a solution, So help will be greatly appreciated annex

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      What do you mean by "pops"?? How are you accomplishing what you already have?? If it's launching a "mailto:" link, attachments are not supported.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      1 Reply Last reply
      0
      • A annex45

        I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields.. question is, given a file path,how do i automate the process of attaching a file to that email and sending it? Scoured the web without finding a solution, So help will be greatly appreciated annex

        B Offline
        B Offline
        BobJanova
        wrote on last edited by
        #3

        You need to read the SMTP spec for multipart messages and MIME encoding.

        1 Reply Last reply
        0
        • A annex45

          I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields.. question is, given a file path,how do i automate the process of attaching a file to that email and sending it? Scoured the web without finding a solution, So help will be greatly appreciated annex

          M Offline
          M Offline
          Manfred Rudolf Bihy
          wrote on last edited by
          #4

          If I were you I'd use the .NET API to achieve your goal. See here: MailMessage Class[^]. It even sports an example with an Attachment[^]. Regards,

          — Manfred

          "I had the right to remain silent, but I didn't have the ability!"

          Ron White, Comedian

          1 Reply Last reply
          0
          • A annex45

            I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields.. question is, given a file path,how do i automate the process of attaching a file to that email and sending it? Scoured the web without finding a solution, So help will be greatly appreciated annex

            J Offline
            J Offline
            Jason Gleim
            wrote on last edited by
            #5

            You don't mention if but if you are working with Outlook as the local mail agent, there are a number of pain is the butt things you have to look out for... including the security authorization pop-up when you try to send mail via Outlook from another application and the restrictions around attachment types and the automatic stripping that can occur. If you have to deal with Outlook, there is a library called the "Outlook Redemption" library which makes it a breeze. I've used it before and it is by far the best way to deal with Outlook as the local mail agent. Especially if you have to send via Exchange because you don't have to setup a risky SMTP relay on the exchange server. The website is here: http://www.dimastr.com/redemption/home.htm[^] And best of all, you can send e-mail as the current user without their intervention... no need to 'pop' the message if you don't want to.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups