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