Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

calling eudora and netscape within Delphi

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
michaelsanders
Asked:
michaelsanders
  • 2
1 Solution
 
icampbe1Commented:
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
 
michaelsandersAuthor Commented:
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
 
icampbe1Commented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now