by
JADE News Administrator >> Thu, 29 Oct 1998 1:18:43 GMT
Hi
I have achieved my objective of being able to issue emails from a JADE application to an SMTP mail server.
I setup the External Function shellExecute (as described in Geoff Davies submission). This is very useful as it allows you to call many Windows programs (with parameters) from within JADE e.g. Word, Excel, Notepad --- as well as the New Message dialogue of your email client. With the latter it can pre-fill the recipients email address -- but that's as far as it goes. You can't fill the text of the email or have it sent automatically.
I scanned the Internet for SMTP tools and came across "SendMail for Windows" from the WinFiles.com NT Mail clients site --- you can get it too from
http://www.winfiles.com/apps/nt/mail-clients.html
This allows you to install SendMail as a Windows application. You have to configure it to register your mail servers host name -- but that's about it.
Then within your JADE application you have to create a temporary ASCII text file with some header information detailing who you are sending the email to, who it's from and the subject --- and then the actual text you wanna send.
The disadvantages of this approach is that :
this is making use of the third party utility and this one anyway has to be registered and paid for for commercial use
it's a "command line utility" (and a "convert job" from UNIX) so unfortunately it displays a yukky DOS box for a few seconds
There are other utilities around and I would welcome feedback on other peoples experience with them?
Ideally the shellExecute function should be part of JADE and extensible(!) to allow the email text to be passed and an instruction to automatically send the email. Perhaps this will be included with JADE 5 ?
Here is a JADEScript I wrote for testing it :
vars
tempfile: File;begin
create tempfile;
tempfile.fileName := "C:\temp\TEMPMAIL.TXT";
tempfile.kind := File.Kind_ANSI;
tempfile.mode := File.Mode_Output;
tempfile.writeString("Subject: Its life Jim -- but not as we know it" & CrLf);
tempfile.writeString("From: Alan Thomson<
athomson@clear.net.nz>" & CrLf);
tempfile.writeString("To: Alan Thomson<
athomson@cardinal.co.nz>" & CrLf & CrLf);
tempfile.writeString("With reference to Complaint: 00345 raised 17 Jun 1998" & CrLf);
tempfile.writeString("You have been assigned responsibility" & CrLf); tempfile.writeString("Please accept or otherwise within JACS ASAP" & CrLf);
tempfile.writeString("." & CrLf);
call
shellExecute(1,"open","sendmail"," -messagefile=c:\temp\TEMPMAIL.TXT -t", null, 1);
end;
Ciao .................
Alan J.Thomson
ph...Auckland 09-277-7961 x 744
http://home.clear.net.nz/pages/athomson