Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Start E-Mail composer from Delphi?

Status
Not open for further replies.

premiK

Programmer
Jan 8, 2002
22
CA
Hi

How can I open an e-mail composer from my Delphi application?

Default mail: Netscape;
Delphi 4
win98

Can any one help me please? Thank you in advance.

 
A few options for you:

Sample code to start default e-mail client on host machine:

This works. %0D%0A for line feed.
ShellExecute(handle,'open','Mailto:simon@simonhooper.co.uk?subject=Task list&Body='+'This is the body%0D%0AAnd another line',nil,nil,SW_SHOWNORMAL);

Can also use HTML formatting:
ShellExecute(handle,'open','Mailto:simon@simonhooper.co.uk?subject=Task list&Body='+'<HTML>This is the body<BR/>And another line</HTML>',nil,nil,SW_SHOWNORMAL);

Apparently can specify attachments also, but this doen't seem to work with Outlook Express (v5)
&Attach=&quot;c:.txt&quot;

this has been suggested, but doesn't seem to work
WinExec('start &quot;mailto:shmia@bizerba.de?subject=Barcode component&quot;',SW_HIDE);

Have fun
 
As you said I used shellexecute Api function.
It works fine if my default mail is MicrosoftOutlook , it just open
e-mail composer only.
If my default mail is netscape(version 4.79) the Netscape browser and
two e-mail composer also open, if it is netscape(version 7.0) the
Netscape browser and one e-mail composer also open. If the netscape
browser is already opened in my desktop before I run my application the
application open only one e-mail composer, in this case it work fine.
I want to open only one e-mail composer with any circumstance.

Can you help me?
Thank you very much.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top