Board index » delphi » Email link

Email link

How do I make an email address display as an email link. ie just click on it
and the email program fires up.

Thanks in advance.

 

Re:Email link


Hello, "stevew" <Ste...@om2.co.uk>! You wrote:

Quote
> How do I make an email address display as an email link. ie just click on
it
> and the email program fires up.

Put a label on your form, make its color blue, define an OnMouseMove event
in that you have to change the cursor style.
In an OnClieck event handler put code like this:

ShellExecute(0, 'open', 'mailto:a...@b.c', '', '', SW_OPEN);

--
    Evgeny V. Levashov, Software Developer,
    ICQ UIN 34864288
    Mebel Massiv Co, Tula, Russia
    http://home.tula.net/mebelmassiv

Re:Email link


In an article about "Email link", stevew <Ste...@om2.co.uk> wrote...

Quote
>How do I make an email address display as an email link. ie just click on it
>and the email program fires up.

Hi,

I'm using Delphi 5 here, and I pop a label on the form and set its font
properties to blue / underlined.  I set its cursor property to
crHandPoint.  Then I use the following OnClick event handler for the
label...

procedure TWhatEverForm.emailClick(Sender: TObject);
var
  emailAddress, emailSubject, emailBody, emailStr: string;
begin
  emailAddress := 'mailto:y...@email.address.here';
  emailSubject := '?Subject=' + Application.Title;
  emailBody := '&Body=Write me a note here !';
  emailStr := emailAddress + emailSubject + emailBody;
  ShellExecute(0, Nil, PChar(emailStr), Nil, Nil, SW_SHOWNORMAL);
end {TWhatEverForm.emailClick};

--
Cheers,    >>>  mailto:d...@thegibsons.demon.co.uk   <<<
           >>>        ICQ 392790    IRC Gibby        <<<
Drew ;^)   >>>   http://www.thegibsons.demon.co.uk   <<<

Other Threads