Link to home
Start Free TrialLog in
Avatar of dummyy
dummyy

asked on

start outlook from within my application

How can I startup Outlook from within my delphi3 application, for example to send a message?
ASKER CERTIFIED SOLUTION
Avatar of viktornet
viktornet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tulip
Tulip

You can better use the TEmail component.
It directly uses MAPI functions so that you can compose messages within your
Delphi app and you don't have to start Outlook first.
For details, see the example included in the zip-file.

http://www.torry.ru/vcl/internet/temail2.zip
To start a default e-mailer you use this...

ShellExecute(0, 'open', 'mailto:viktor@megsinet.net', nil, nil, SW_SHOWNORMAL);

I think that if you use this following
ShellExecute(0, 'open', 'mailto:viktor@megsinet.net', 'Your Subject', nil, SW_SHOWNORMAL);
you can include your subject for the maill...

-Viktor
--Ivanov
Avatar of dummyy

ASKER

Your answer is correct but while trying to implement it, Delphi couldn't find the shell32.lib. Meanwhile I've got an answer from Tulip which seems more prefarable. Thanks anyway for answering my question.
It couldn't find it because you didn't include it... I'm sorry for forgetting to tell you that you need to include it...

uses ...., ShellAPI;

as you can see you need to add ShellAPI to your uses clause... Hope this helps...

Cheers,
Viktor
Avatar of dummyy

ASKER

Thanks, it's completely correct, I was looking for shell32.lib and couldn't find it. I guessed already that it should be something like you mentioned. Thanks.