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. adding attachments to an email

adding attachments to an email

Scheduled Pinned Locked Moved C#
csharpcomquestion
2 Posts 2 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
    Aviv Halperin
    wrote on last edited by
    #1

    Hi, I found an article that shows a simple way to open the default email client with some parameters set. http://www.codeproject.com/dotnet/Default_mail_client.asp[^] Only thing is: the attachment does not work. (MsgBuilder.Append("&Attach=c:\mailattach.txt")) Is there any way to open the default email with an attachment? Thanks. avivhal

    H 1 Reply Last reply
    0
    • A Aviv Halperin

      Hi, I found an article that shows a simple way to open the default email client with some parameters set. http://www.codeproject.com/dotnet/Default_mail_client.asp[^] Only thing is: the attachment does not work. (MsgBuilder.Append("&Attach=c:\mailattach.txt")) Is there any way to open the default email with an attachment? Thanks. avivhal

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      As covered on this forum many times before (which is why the "Search comments" link above exists), not all MAPI clients support every syntax. It wasn't even that long ago that most MAPI clients like Outlook, Outlook Express, Netscape, and others supported the "Body" parameter. This also means that a client must have a MAPI client registered. Rather than relying on what's installed - which gives you little to no control as you've found - send the mail yourself using SMTP. There are many articles here on Code Project as well as on this forum. You can also get third-party libraries like IP!Works[^]. Using the System.Web.Mail namespace is also a bad idea because it requires a CDO library for the system. Only Win2K and above have this client library. NT4 uses something else, IIRC, and Windows 98/Me have nothing. True SMTP support is being added to the .NET Framework for "Whidbey" (.NET 2.0) to replace this hazardous namespace. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

      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