Board index » delphi » Sending Email using default email client

Sending Email using default email client

I have a delphi client application where the users say it would be useful to
create a screen-grab of the application window and email it to someone.  I
can capture the application window and save it as a JPEG, but how do I then
send this JPEG using the users default email program (rather than creating
my own email connection from within my app and having to set up the server
addresses)

Thanks
Martin

 

Re:Sending Email using default email client


This works in my application to call the default email program:

Result := ShellExecute(Application.Handle, 'open',
PChar('mailto:'+EMailAddr), nil, nil, SW_SHOW) > 32

Quote
Martin wrote:
> I have a delphi client application where the users say it would be useful to
> create a screen-grab of the application window and email it to someone.  I
> can capture the application window and save it as a JPEG, but how do I then
> send this JPEG using the users default email program (rather than creating
> my own email connection from within my app and having to set up the server
> addresses)

> Thanks
> Martin

Re:Sending Email using default email client


In article <3A9E886E.3060...@postweb.net>, mdomm...@postweb.net says...

Quote
> Result := ShellExecute(Application.Handle, 'open',
> PChar('mailto:'+EMailAddr), nil, nil, SW_SHOW) > 32

You can add a number of fields to that mailto string. E.g.

'mailto:bi...@microsoft.com?subject=DOJ&cc=lar...@oracle.com&body="Gee%20
whiz!"

See www.rfc-editor.org/rfc/rfc2368.txt for details of what you can
include. I don't see anything about attachments, I'm afraid.
--
Neil J. Rubenking
Contributing Technical Editor
PC Magazine

Re:Sending Email using default email client


Quote
"Martin" <m...@bigfoot.com> wrote in message news:3a9e7ba0_1@dnews...
> I have a delphi client application where the users say it would be useful
to
> create a screen-grab of the application window and email it to someone.

Hi,

Depending on what the default e-mail client is, this task can be anything
from a doddle to impossible.

Using ShellExecute(...,...,'mailto:xxxxxx'......... is not an option because
you can't add attachments. You can using OLE automataion and MAPI.

Outlook is OLE-Automatable but not Outlook Express. They are both MAPI
compliant however, although Outlook Express does suffer a few glitches.

If the default e-mail client to be used is something else like Mozilla or
Eudora, then you're on your own.

I suggest you roll your sleeves up and go for a 3rd-party SMTP client
component and do the sending yourself. 2 which come to mind immediately are
Fran?ois Piette's ICS (http://users.swing.be/francois.piette/indexuk.htm)
and Indy. Alternatively you can look at the usual places: Torry's
(www.torry.net) and DSP (http://delphi.icm.edu.pl).

HTH's

GRS

Other Threads