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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mailto: with Outlook Express 1

Status
Not open for further replies.

Headwinds

Programmer
Feb 6, 2001
38
0
0
US
I'm using ShellExec to prepare some e-mail messages. It works fine in Outlook 2000, but not in Outlook Express 6. In Outlook Express, the entire string ends up as the address. That is, if I set:

lcMail = "mailto:bill@bonzo.com" + ;
"&Subject=Tomorrow&Body=See you."

and issue:

ShellExecute(0,"open",lcMail,"","",1)

The message that is created has the following address:

"bill@bonzo.com&Subject=Tomorrow&Body=See you."

and the Subject and Body areas are empty.

In Outlook, it works just fine.

 
Headwinds

I don't see the declare statement. Are you using one? Try this and see:
Code:
DECLARE INTEGER ShellExecute IN shell32.dll ; 
  INTEGER hndWin, STRING cAction, STRING cFileName, ; 
  STRING cParams, STRING cDir, INTEGER nShowWin

lcMail = "mailto:john@mycompany.com"+ ;
  "?CC= boss@mycompany.com&Subject= Meet for lunch"+ ;
   "&Body= Please join me for a sandwich at noon." 
ShellExecute(0,"open",lcMail,"","",1)
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Headwinds

Sorry for misguiding you, but your problem was the missing question mark:

lcMail = "mailto:bill@bonzo.com" + ;
"?&Subject=Tomorrow&Body=See you."

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Thank you!

This assignment:

lcMail = "mailto:bill@bonzo.com" + ;
"?&Subject=Tomorrow&Body=See you."

now gets the address into the To: line and the body into the body--although the body is preceded by a blank line. But the Subject: line is empty.

To get the subject line to display, I dropped the ampersand after the question mark--but the first line of the body is still a blank line.

 
Headwinds

Since it seems you can only use all the parameters (including the CC) you may want to try using a blank CC parameter.

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, STRING cAction, STRING cFileName, ;
STRING cParams, STRING cDir, INTEGER nShowWin

lcMail = "mailto:john@mycompany.com"+ ;
"?CC=&Subject= Meet for lunch"+ ;
"&Body= Please join me for a sandwich at noon."
ShellExecute(0,"open",lcMail,"","",1)
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Does that work for you? When I paste the commands from your post into the Command Window and run it, I still get a blank line at the start of the message. (Shrug)
 
Headwinds

Does that work for you? When I paste the commands from your post into the Command Window and run it, I still get a blank line at the start of the message. (Shrug)

Seems to create an extra line. I cannot get ride of it. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Out of curiosity, I gave the code a try, and it works fine... with Eudora v4.2. There are no extra blank lines; So this must be an Outlook Express-specific problem.
 
wgcs

Out of curiosity, I gave the code a try, and it works fine... with Eudora v4.2. There are no extra blank lines; So this must be an Outlook Express-specific problem.

Interesting... Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
HeadWinds,
I had the same problem with a machine that was upgraded to XP and had Outlook Express 6.0 installed with it. It turned out the default email was not registered properly to work the same way it did before. If you go to 'Folder Options'/'File Types, the default email is under a URL type entry. Check to see that it setup with the 'Use DDE' box checked. (I just checked mine and that is the setting that works the same way it used to work before the upgrade.) I didn't have to make any program changes once I got the file type settings right.

Let me know if you need help getting those settings.

WJS

PS I probably could have used gooder english but I was kind of in a hurry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top