vb.net winform app opening the user's email client w/ attachments

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Hi,

Sorry if this is not the best news group for this...

We are converting a VB6 app to .net and need to replace some functionality
that we used to get from a COM component (IDSMail).

We need to allow a user to send email from within our app. The problem is
that we need to do this with different mail clients (Outlook, Lotus Notes,
Novell Groupwise, etc.). We need to have files attached when the email
client opens the new message.

The reason that we neeed to open the user's email client is so that their
address book is available.

I'd build a MAILTO string and call:
System.Diagnostics.Process.Start(UrlString)
if I didn't need to attach a file.

One thing I thought of (but don't know how to do) is to try and simulate
right-clicking on the file and calling "Send To Email Recipient". Even if I
knew how to do this, I'm not sure it would work on non Microsoft email
agents.

Any ideas?

Thanks,

Jim
 
Hi,

In order to send emails with file attachments using the user's default email
application (including non-Microsoft email clients that adhere to the
standard) you can use Simple MAPI. The interface allows you, amongst other
things, to specify the text for a message and its attachments, then have the
email program display it in a window so that your users can choose an
address.

Simple MAPI is documented in Windows SDK here:

http://msdn.microsoft.com/library/d...ry/en-us/mapi/html/_mapi1book_simple_mapi.asp

I could not find a VB.NET port of the interface after searching for a while
but the following C# sample code may help you:

http://www.codeproject.com/csharp/simplemapidotnet.asp

You may also find you can use the MAPI controls from VB6 in VB.NET:

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21018544.html

I hope that helps,


Jonathan Holmes
 
Wow! Thanks for the terrific response.

Unfortunately, I don't think that Lotus Notes is MAPI compliant. Some of
our larger clients use Lotus Notes.

Nonetheless, this MAPI insight will be very useful.

Thanks,

Jim
 
Back
Top