Board index » delphi » How to send emails using default email program

How to send emails using default email program

Hi all,

I would like to be able to show the new email dialog of the default email
program and I would also like to be able to assign the basic fields (From,
To, CC, Subject, Message and Attachments).

I have tried with 'mailto:addr...@isp.com?subject=xxx'... but do not know
how to assign other fields (and it did not launch Netscape emailer).

I have also tried with MAPI, but can not get control of the form.

Please, does anyone know how to launch the default email program and how to
consistently fill the fields in it?

Thanks for your help
Manuel Sebares
m...@idecnet.com

 

Re:How to send emails using default email program


    themessage:= 'mailTo:j...@yahoo.com?subject=this is the
subject&Body=This is the body.';
    ShellExecute(0, nil,pchar(themessage), nil, nil, SW_RESTORE);

To add cc you would add &cc=jane....@yahoo.com

Not all the fields come in on all email clients, you will have to
experiment.

Tony

Re:How to send emails using default email program


Also note that if your Body or Subject contain the characters
& or + it will corrupt the message.

--
Carl.

Quote
"Tony" <tcad...@execpc.com> wrote in message news:3ad520ad$1_1@dnews...
>     themessage:= 'mailTo:j...@yahoo.com?subject=this is the
> subject&Body=This is the body.';
>     ShellExecute(0, nil,pchar(themessage), nil, nil, SW_RESTORE);

> To add cc you would add &cc=jane....@yahoo.com

> Not all the fields come in on all email clients, you will have to
> experiment.

> Tony

Re:How to send emails using default email program


I belive this will only work with outlook v5 and greater
Quote
"Carl" <car...@btclick.com> wrote in message news:3ad586c6_1@dnews...
> Also note that if your Body or Subject contain the characters
> & or + it will corrupt the message.

> --
> Carl.
> "Tony" <tcad...@execpc.com> wrote in message news:3ad520ad$1_1@dnews...
> >     themessage:= 'mailTo:j...@yahoo.com?subject=this is the
> > subject&Body=This is the body.';
> >     ShellExecute(0, nil,pchar(themessage), nil, nil, SW_RESTORE);

> > To add cc you would add &cc=jane....@yahoo.com

> > Not all the fields come in on all email clients, you will have to
> > experiment.

> > Tony

Other Threads