BBC BASIC for Windows
Programming >> Communication and Input/Output >> Sending email http://bb4w.conforums.com/index.cgi?board=communication&action=display&num=1393405753 Sending email
Post by KenDown on Feb 26th, 2014, 08:09am
I've tried creating an e-mail using the ShellExecute method, which works fine so long as body$ is fairly short. When I tried putting the whole message in body$, although PRINTbody$ showed the whole message, the e-mail client failed to open.
Is there a limit on the length of body$? Can the e-mail be written into the e-mail client (I use FireFox) after it has opened?
Any other suggestions appreciated.
Re: Sending email
Post by admin on Feb 26th, 2014, 08:24am
What version of Windows? My understanding is that the limit is greater in Windows 7 than it is in Windows XP, for example.
But irrespective of the Windows version there is a limit of 32767 characters imposed by Create Process, so you won't be able to exceed that when data is passed on the 'command line'.
Richard. Re: Sending email
Post by KenDown on Feb 26th, 2014, 1:18pm
Hmmmm. This is Windows XP, but I've just checked and the letter I wanted to send is exactly 2,000 characters long, so well within the limit you mention.
Re: Sending email
Post by admin on Feb 26th, 2014, 2:45pm
This is Windows XP, but I've just checked and the letter I wanted to send is exactly 2,000 characters long, so well within the limit you mention.
The limit I mentioned is for CreateProcess; you are not using CreateProcess! The limit for ShellExecute on Windows XP is indeed around 2000 characters, I believe:
The limit is much greater in Windows 7, and presumably 8 (maybe the full 32767 characters); I don't know about Vista.
This is another reason not to be using Windows XP (support for that OS will be discontinued by Microsoft in April). If for some reason you must use XP you will have to switch from using ShellExecute to using CreateProcess, which means doing a lot more of the work yourself.
Richard.
Re: Sending email
Post by KenDown on Feb 27th, 2014, 04:10am
Ok, thanks for that information. As it happens, having to click "Send" is no bad thing as it gives me opportunity to review the automatically generated message and personalise it.
I'm in no hurry to "upgrade" to Vista or 7, though I suppose I will be forced to do so eventually. I have both on one or other of my laptops and see no advantage in them. What is worse, I can see the day coming when they too will not be supported and we'll be forced into using the apalling 8.1 (which I have on a tablet and don't like at all!)