Thursday 12/11/2008 17:00

Easy Email by Nullified

How to write your own email label or button in delphi

See also:


This little tutorial will take you only 1/2 aminute!

-----------------------------------------------------------------------------------------
1. Open up delphi
-----------------------------------------------------------------------------------------


-----------------------------------------------------------------------------------------
2. Add shellAPI to the uses clausule of Form1
-----------------------------------------------------------------------------------------
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ShellAPI, Buttons;



-----------------------------------------------------------------------------------------
3. Next drop a button and a label on Form1, and click on the OnClick event in the property editor
-----------------------------------------------------------------------------------------
procedure TForm1.Label1Click(Sender: TObject);
 var
  Email : PChar;
 begin
 Email := 'mailto:delphi7@chello.nl';
 Shellexecute(handle, 'open', Email, nil, nil, SW_SHOW);
end;

procedure TForm1.Button1Click(Sender: TObject);
 var
  Email : PChar;
 begin
 Email := 'mailto:delphi7@chello.nl';
 Shellexecute(handle, 'open', Email, nil, nil, SW_SHOW);
end;




-----------------------------------------------------------------------------------------
4. Save and compile this, you have just created your own email button and label, and you do not have to rely on third party components anymore, saving you copyright infringements and thank you's haha
-----------------------------------------------------------------------------------------

Easy Email by Nullified can be downloaded together with demo files at my site for free for always go here