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

Shellexecute() with mailto and attachments

230 views
Skip to first unread message

Gunnar Einarsson

unread,
Oct 23, 2000, 3:00:00 AM10/23/00
to
Hi

How can I add a attachment with shellexecute() and mailto.

I have tryed this but the attachment doesnt work.

var
messg : string;
begin
messg := 'mailto:?to=pa...@domain.com' +
'&subject=new email' +
'&body=howdy today?' +
'&attachments=c:\image.gif';
ShellExecute(0, nil, PChar(messg), nil, nil, SW_SHOWNORMAL);
end;

regards
Gunnar

Kamikaasje

unread,
Oct 24, 2000, 3:00:00 AM10/24/00
to

Unfortionately Mailto does not support the use of attachments. You'll have
to use something else, like MAPI for instance.

Steven D'Abrosca

unread,
Oct 24, 2000, 3:00:00 AM10/24/00
to
> Unfortionately Mailto does not support the use of attachments. You'll have
> to use something else, like MAPI for instance.
>

This is not entirely true. I used 'mailto' from ShellExecute to send an
attachment as part of an e-mail. If you use the shellexecute like this...

ShellExecute(Handle, 'open',
'mailto:Some...@Somewhere.com?subject=MySubject&Attach=''C:\Attachment.txt'
'', nil, nil, SW_SHOW)

The keys are this...
(1) The attachment (&Attach) must be the last in the list
(2) The path & filename of the attachment must be in a separate set of
quotes
(3) Not all email clients accept the 'attach' command. I found it works
with Outlook 97 & 2000.


steve dabrosca

Gunnar Einarsson

unread,
Oct 24, 2000, 3:00:00 AM10/24/00
to
Thanks.

It works.

Gunnar Einarsson

"Steven D'Abrosca" <stdab...@cvs.com> wrote in message
news:39f5aa06$1_2@dnews...

0 new messages