[AccessD] ShellExecute to sendshorte-mailvianon-MSemailclients...

Shamil Salakhetdinov shamil at users.mns.ru
Sun Nov 6 20:15:56 CST 2005


Thank you for your feedback, William!

Yes, it's possible to create C++ ATL/COM ActiveX Control but this is quite
some work - I don't think I will have free time for it in the near and not
that near future.
Another way is to create C++ ATL/COM ActiveX DLL with a simple API interface
to send e-mails, read e-mal boxes etc., to wrap and expose MAPI
functionality, which isn't available in VB6/VBA. This is less work than C++
ATL/COM ActiveX control but still some work I have to find free time for. It
may happen somebody did develop similar ActiveX  already .
Third way (will work only with .NET Framework installed) is to develop
ClassLibrary on VB.NET or C# and expose its API using CCW(COM Callable
Wrappers).
Fourth way (the shortest) is to create ActiveX control in .NET -
http://www.c-sharpcorner.com/Code/2003/March/ActiveXInNet.asp - I have never
tried that - if it will work as described in referenced article then the
sample code I previously
referred(http://www.codeproject.com/csharp/simplemapidotnet.asp,) can be
wrapped into ActiveX control, which can be used in MS Access forms I hope.
The fifth way... (there are many others like using Delphi to develop ActiveX
control etc.)

Recap:
=====
1. The first way is the longest but promise to bring the best results;
2. The fourth way is the shortest - but I'm unsure about result. And it will
need .NET Framework installed on clients' PCs;
3. The second and the third ways will not result in ActiveX controls'
development, which are the most desired result AFAIS.....

Shamil

----- Original Message ----- 
From: "William Hindman" <wdhindman at bellsouth.net>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Sent: Saturday, November 05, 2005 5:10 PM
Subject: Re: [AccessD] ShellExecute to
sendshorte-mailvianon-MSemailclients...


> Shamil
>
> ...your compilation works great on my OE account ...but is there any way
to
> have this execute from inside an Access form ...like a subform for
instance?
> ...I've been looking for this functionality for quite some time for my
> clients using Outlook Express ...would also need to be able to read
folders
> other than the Inbox.
>
> William
>
> ----- Original Message ----- 
> From: "Shamil Salakhetdinov" <shamil at users.mns.ru>
> To: "Access Developers discussion and problem solving"
> <accessd at databaseadvisors.com>
> Sent: Friday, November 04, 2005 8:21 PM
> Subject: Re: [AccessD] ShellExecute to send
> shorte-mailvianon-MSemailclients...
>
>
> > 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
> >
> > -- 
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
>
>
> -- 
> 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