• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2551
  • Last Modified:

ShellExecute mailto

I've used the ShellExecute call to send an e-mail through Outlook 2000 as noted below.  What I would like to know is this:  What are the other options (if any) for 'open'?  I'm trying to send the e-mail without the user having to click their send button.

ShellExecute(0, 'open', PChar('mailto:jdoe@hotmail.com?subject='blah'), nil, nil, SW_SHOWNORMAL);
0
MBliv
Asked:
MBliv
1 Solution
 
DavidRissatoCommented:
No, as far as i know, there is no way to send directly using mailto: protocol.

You can even define the body of your message but you can't instruct the program to send it automaticaly (it would lead to a security hole in the system)

If you need to send data through Outlook, you can instantiate its COM implementation. There's a wrapper component called OutlookApplication that can be found under "Server" tab of your Delphi Component Palette.

There's some effort envolving this task (you need to look MSDN documentation about Outlook COM interface) but this is the only way to do what you want.

{}'s
David Rissato Cruz
0
 
Stuart_JohnsonCommented:
Our just use the SMTP components bundled with [most versions of] Delphi.  But that won't interface with Outlook, so no entry will be added to the Sent Items folder (if that's what you're looking for).
0
 
merry_princeCommented:
David Rissato Cruz,

Can we use mailto: protocol with the attachment?
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
Stuart_JohnsonCommented:
I'll answer it for him.  No.

You can have to, cc, body and subject.  That's all it supports.
0
 
merry_princeCommented:
Thanks a lot.
0
 
MBlivAuthor Commented:
Thank you for the answer.  The solution (or possible lack thereof) was stuck in my head.  The OutlookApplication component has pointed me in the right direction.  Thanks a million!  
0
 
merry_princeCommented:
What a pity! This method is only effective for outlook 2000, but not OE(outlook express).
That's it. Really. Is it impossible to automate Outlook Express (except using mailto protocol)? Please advise.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now