[DUG] Default email

John Bird johnkbird at paradise.net.nz
Tue Jun 22 11:24:37 NZST 2010


This routine does this, in this case there are variables declared elsewhere  Email, Subject, BodyText that are all strings and already populated.

Note some mail clients (Outloook Express) don't like the BodyText variable being longer than a dozen or so characters.

procedure Tform1.makeEmail;
var
mailto:string;
begin
 mailto:='mailto:'+email+'?Subject=trim(Subject)+'&Body='+BodyText;
  if ShellExecute(Application.Mainform.Handle, 'open',Pchar(mailto), nil, nil, SW_SHOWNORMAL) <= 32 then
    ShowMessage(SysErrorMessage(GetLastError));
end;

JohnFrom: David O'Brien 
Sent: Tuesday, June 22, 2010 10:50 AM
To: NZ Borland Developers Group - Delphi List 
Subject: [DUG] Default email


Does anyone have any code that would open a New Email window ready for input in the default email client, and populate the To: address?

 

Regards,

Dave.

 



--------------------------------------------------------------------------------


_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20100622/945279d0/attachment.html 


More information about the Delphi mailing list