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

Email link not working

Status
Not open for further replies.

Bryan - Gendev

Programmer
Jan 9, 2011
408
AU
Just getting the final testing prior to release of the latest version of my app.

To enable users to contact me I have a ContactUs form with a cmd button -I have the following code on the cmd button click() event as per FAQ

Code:
	DECLARE integer ShellExecute IN shell32.dll ;
		integer hndWin, string cAction, string cFileName, ;
		string cParams, string cDir, integer nShowWin

	LOCAL lcMail
*!* Replace the email addy below with a valid one

	lcMail = "mailto:met@internode.on.net";
	 + "&Subject= V9 Comments";
	 + "&Body= Dear User, ";
	 + " I will answer your query as soon as possible!.";
	 + 	"                                                                 ";
	 + 	" Hi BeeBee,"

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

	Clear DLLS ShellExecute

I have Thunderbird on my PC and when I press the button I get a message

Postbox is already running but is not responding. To open an new window, you must first close the existing Postbox process, or restart your system'

This happens whether or not TBird is running or not.

Can anyone help with this?

Thanks

GenDev
 
GenDev,

First, just a small matter of detail: You need ? before your first mailto parameter, not &. In other words, you need this:

Code:
+ "[b]?[/b]Subject= V9 Comments";

Regarding the bigger problem, this is a Thunderbird issue, not a VFP one. I suggest you temporarily set Outlook or Outlook Express as your default email client, and check what happens. If it runs correctly (and I think it will), then you need to look at your Thunderbird configuration.

Mike





__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks Mike,

Maybe someone else uses TBird and can tell me where to look in its configuration...

GenDev

 
The ShellExecute of mailto-Links is not working universally, there has to be a mailto: handler configured properly.

I quick search of "Thunderbird Mapi" revealed a question about how to setup thunderbird to be accessible by MAPI, which suggests this is not the default setup with Thunderbird.
After following two links I arrive at a mozilla support page about mapi:
So you may forward that instructions to your customer and let them troubleshoot their OS and Thunderbird settings.

There also are ways to send mail without depending on a mail client being present and being configured for MAPI, you can choose from very many other solutions, see Some of these are not depending on MAPI or even a mail client being present, see the Requirement column.

The downside of that is, the mails sent will not go into any outbox or sent itmes of a mail client for archiving - even if a mail client is present. If that doesn't matter, BLAT.DLL is a nice solution and another self contained solution is VFPWinsock +Sendmail. Both are mentioned in the wiki overview about mail options you can use.

You see with Mailto the requirement is >>Some handler installed for "mailto:"<<, and that is not the case with just any mail client. Blat and VFPWinsock+SendMail both have the disadvantage you need to know what SMTP Server to send mails to, this is of course the disadvantage to not being able to use some mail client, you have to know a mail server yourself, but you can of course do what mail clients also do and make mail server and authentication credentials part of your apps configuration.

Bye, Olaf.
 
Of course, the advantage of the way that GenDev is doing it is that he doesn't have to provide a user interface for composing and editing the message. The user can compose the message using their familiar email client, with access to its full range of features (stationery, spell checking, archiving, etc).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Another thing:

As Mike said "this is a Thunderbird issue, not a VFP one". To prove that to unsatisfied customers claiming your app to be faulty, let them just use any mailto:link from any website, this would cause the same problems as your shellexecute. Then they'll see it's not your app. Still using something not depending on a correct configuration of a standard mail client is giving you less trouble.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top