Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Automate Any Email Client

0 views
Skip to first unread message

atif

unread,
Jul 28, 2008, 1:51:24 AM7/28/08
to
Hi,
I want to automate any email client running on Windows and save the
generated email in as Draft.

I was trying to use MAPI control with VB6 but when i save it gives

"Unspecified Failure has occured"

The case is same with COM MAPI objects
(CreateObject("MSMAPI.MAPIMessages"))
And one more thing is Send method works fine on my PC but it gives

"ActiveX Component can't create object"
on client machine, i have verified required files with Dependency
Walker, both machines are showing same result. The Client has
Microsoft Outlook as a default and i have Outlook Express as default.

However, my intention is

1- Automate any email client (without any dependency on email Server)
2- Save the message as Draft

Kindly suggest a solution to achieve this

mayayana

unread,
Jul 28, 2008, 8:51:25 AM7/28/08
to
You can't automate "any" email program.
If you want to send email without needing an
email program you can do it directly. Search
for vbSendMail for a DLL, or see here for
dependency-free, all-VB code:

www.jsware.net/jsware/vbcode.php5#mail

> 1- Automate any email client (without any dependency on email Server)

The links above provide alternatives to
email software. That's not the same as an
email server. If you mean that you don't want be
required to contact an SMTP server (the outgoing
mail server, such as smtp.someisp.com) then you
have to also somehow provide/write your own SMTP
server.


atif

unread,
Jul 28, 2008, 9:14:13 AM7/28/08
to
On Jul 28, 6:51 pm, "mayayana" <mayaXXy...@rcXXn.com> wrote:
> If you mean that you don't want be
> required to contact an SMTP server (the outgoing
> mail server, such as smtp.someisp.com) then you
> have to also somehow provide/write your own SMTP
> server.

Thanks for your reply

I don't mean writing my own SMTP server, i mean whatever the server is
i don't need to change my code/whatever to support a specific server..

And by the way, I don't want to send email via SMTP because as per my
knowledge, the email sent will not be seen by the email client of end
user. And most importantly, i don't want to send the email i just want
to Save it as Draft which means automate client's default email
software (Outlook Express, Microsoft Outlook, Thunderbird, etc).

Dean Earley

unread,
Jul 28, 2008, 9:53:33 AM7/28/08
to

You will have to find a way of automating each one individually.
There is no standard method of access the folder structure (and may not
even exist in some cases)

--
Dean Earley (dean....@icode.co.uk)
i-Catcher Development Team

iCode Systems

expvb

unread,
Jul 28, 2008, 12:13:50 PM7/28/08
to
As others suggested, there is no standard way of automating all email
clients. Outlook is the easiest because it has an automation model. MAPI can
be used with Outlook and Outlook Express, it will get the messages from the
one that you made the default email program. If you have thousands of
messages in your Inbox, when you use Fetch method; it could take few minutes
and CPU usage spikes to 100%. To avoid this, move most of the messages to a
custom folder, or use FetchUnreadOnly property to reduce the number of
messages. I am not sure if this can be sped up using the API. This also
depends on the intended usage.

Another option for OE, is to write an EML file, then open it with
ShellExecute. This opens a window with the email text, but does not send it,
unless you send keystrokes(Alt+s) using PostMessage or Sendkeys. See this
VB6 sample and related samples:

http://vbnet.mvps.org/index.html?code/internet/shellexecutelargeemail.htm


atif

unread,
Jul 29, 2008, 2:21:23 AM7/29/08
to
On Jul 28, 10:13 pm, "expvb" <nob...@cox.net> wrote:
> As others suggested, there is no standard way of automating all email
> clients.
I used COM MAPI to send emails and the email i sent was there in my
Sent folder, i tested this method for Outlook Express, MS Outlook and
Thunderbird and it worked well. But the problem is email was sent not
saved as Draft, and to save it as Draft i think some automation
support will be required.

There are some APIs like MAPILogon, MAPISaveMail, MAPISendMail but i
couldn't found a working example for MAPISaveMail. if MAPISaveMail
saves messages in specified folder then it might be used to support
above clients for my specific needs.

Jeff Johnson

unread,
Jul 29, 2008, 12:18:18 PM7/29/08
to
"atif" <atif....@gmail.com> wrote in message
news:0e7eab2c-7ddb-481f...@79g2000hsk.googlegroups.com...

>> As others suggested, there is no standard way of automating all email
>> clients.

> I used COM MAPI to send emails and the email i sent was there in my
> Sent folder, i tested this method for Outlook Express, MS Outlook and
> Thunderbird and it worked well. But the problem is email was sent not
> saved as Draft, and to save it as Draft i think some automation
> support will be required.

Look, it doesn't matter how badly you want to do this, it simply CAN'T BE
DONE with "any email client" as your subject indicates. Not every client
supports MAPI, and not every client supports Automation, and some don't
support either. You're banging your head against a wall here.


atif

unread,
Jul 30, 2008, 12:49:23 AM7/30/08
to
On Jul 29, 10:18 pm, "Jeff Johnson" <i....@enough.spam> wrote:

>it simply CAN'T BE DONE with "any email client"

:(, i wish they come up with some standard interface for automation
while doing/providing optimization/features

> You're banging your head against a wall here

Thanks for stopping me banging my head anymore BUT
Can you provide (link of) a working sample of MAPI via APIs, not
controls

Thank you all guys for this support
(i have stopped looking for automating any client :) )

Nico Notter

unread,
Aug 5, 2008, 11:30:20 AM8/5/08
to
> Can you provide (link of) a working sample of MAPI via
> APIs,

did you check
http://www.planet-source-code.com/vb/default.asp?lngWId=1#categories ?

0 new messages