Solved

calling eudora and netscape within Delphi

Posted on 1997-08-24
3
239 Views
Last Modified: 2010-04-06
I'm writing a program in Delphi 3.0 that pops up when it's one of my friends birthday. I'd like to be able to call an  email-program (any, MS, Netscape, Eudora) from my own program and send him/her a message.
Just to open the email-program and fill in the email address (sort of clicking in a html  document with the mailto: command)

On the other hand it would also be nice, to be able to open an url in Netscape or MSIE the same way ( for one of those free animated greeting card sites )
0
Comment
Question by:michaelsanders
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
icampbe1 earned 100 total points
ID: 1342316
Hi there michaelsanders,

Both of these can be done with the ShellExecute routine.   First, you have to add 'ShellAPI' to you uses clause.  

For the mail, do the following:

VAR Cmd: String;

Cmd := 'mailto:iancamp@interlog.com';
ShellExecute(0, 'open', PChar(Cmd), nil, nil, SW_SHOWNORMAL);
{This will fill in the target address to send mail to me. }

To fire up your default browser with a URL, try this:

Cmd := 'http://www.microsoft.com/';
ShellExecute(0, 'open', PChar(Cmd), nil, nil, SW_SHOWNORMAL);
{this of course goes to the MS home page}

I hope this helps you out.

Cheers,
Ian C.
0
 
LVL 1

Author Comment

by:michaelsanders
ID: 1342317
The command 'mailto:iancamp@interlog.com' doesn't seem to do anything, no Eudora or Netscape pops up. However the 'http://' command works just fine. Thanks Anyway!
0
 
LVL 2

Expert Comment

by:icampbe1
ID: 1342318
It'll work if you have a mail client registered, like Internet mail.  I'm not sure that Eudora registers itself when you install it.  

Cheers,
Ian C.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now