[AccessD] ShellExecute to send short e-mailvianon-MSemailclients...

Shamil Salakhetdinov shamil at users.mns.ru
Fri Nov 4 19:21:12 CST 2005


Stuart,

This looks like an answer! I mean that using only VB6/VBA there is no direct
way to send e-mail via MAPI using Outlook Express ...

Based on that info I did find a C# sample
http://www.codeproject.com/csharp/simplemapidotnet.asp, which works OK with
Outlook Express on my PC without any additional tuning.

I did compile this sample and I did put it for download if somebody don't
have VS.NET 2003 here:
http://smsconsulting.spb.ru/download/tests/mapisample.zip (12KB, requires
.NET Framework 1.1)

Everybody with .NET Framework 1.1 and

Eudora. or Pegasus Mail or Groupwise as well or MS Outlook as default e-mail
clients are welcome to try it:

1. when it starts it reads Inbox
2. clicking on the item in listview you can see message body in textbox
3. clicking [Send Mail...] button you can open a form to prepare and send a
message (put it in outbox)

Now it looks like we are near to have a code, which can popup default e-mail
client's new message window with any size text inside and with attachments.

Stuart, to you have any hints where such (C++, C#, VB.NET) code can be
found - I mean the code, which does what e.g. WinZip does when you
right-click in Explorer and select from popup menu "Zip and E-mail"?

Thank you,
Shamil

----- Original Message ----- 
From: "Stuart McLachlan" <stuart at lexacorp.com.pg>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Sent: Saturday, November 05, 2005 2:45 AM
Subject: Re: [AccessD] ShellExecute to send short
e-mailvianon-MSemailclients...


> On 4 Nov 2005 at 16:54, Shamil Salakhetdinov wrote:
>
> > It would have been great but it(api_SendMail) didn't work with Outlook
> > Express on my PC resulting in a message:
> >
>
> It's a known problem with VB Code and OE.
> See: http://support.microsoft.com/kb/315458/
>
> <quote>
> Calls to the MAPISendMail function that are made from Microsoft Visual
> Basic code may fail with an error message that resembles the following:
> Microsoft Outlook Either there is no default mail client or the current
> mail client cannot fulfill the messaging request. Please run Microsoft
> Outlook and set it as the default mail client.
>
> This problem often occurs when Microsoft Outlook Express is set as the
> default mail client.
>
> CAUSE Visual Basic programs that use Simple MAPI typically use Declare
> statements that import the BMAPI functions. When Outlook Express is the
> default mail client, the MAPI stub library cannot route these calls to
> Outlook Express; instead, the calls fail and an error message is
displayed.
>
>
> RESOLUTION One way to resolve this problem is to not use Declare
statements
> that reference the BMAPI functions. However, because Visual Basic cannot
> call the non-BMAPI functions (unless you manipulate the required
structures
> at the binary level), you may want to write code to call the Simple MAPI
> functions from a language that can handle the structures, such a C or C++.
>
> Two other resolutions are provided at the end of the "More Information"
> section.
> </quote>
>
> -- 
> Stuart
>
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list