From: | Thomas Hurst |
Date: | 28 Jan 2000 at 18:11:43 |
Subject: | Re: aml.library |
From: "Thomas Hurst" <tom.hurst@clara.net>
Hi
On 25-Jan-00 20:50:11, Nuno Maltez (eq3nmf@eq.uc.pt) wrote:
> Is there a way of accessing the functions of OS3.5 aml.library
> from ARexx?
I'm not sure you should seeing as it's hardly been adopted as the
standard... 3.5 hasn't exactly set the world alight.
> Or is there any other way (rexx library?) of getting mail sending
> and header parsing functions in ARexx (without using an existing
> mail program's port)?
Of course, use tcp: device (eugh) and/or rxsocket.library.
Luckily sending email's quite easy.
A simple mailer might look like this:
/* bool = SendMail(to,from,subject,body,server[:port]) */
SendMail: PROCEDURE
to=arg(1);from=arg(2);subject=arg(3);body=arg(4);server=arg(5);sent=0;CRLF='d'x||'a'x
parse var server server':'port
if port=='' then port=23
sock=OpenConnection("tcp",port,server)
if sock>-1 then
do
call recvline(sock,"BUFF",256)
if left(BUFF,3)=='220' then
do
call send(sock,'HELO bla'CRLF)
call recvline(sock,"BUFF",256)
if left(BUFF,3)=='250' then
do
call send(sock,'MAIL FROM:'from||CRLF)
call recvline(sock,"BUFF",256)
if left(BUFF,3)=='250' then
do
call send(sock,'RCPT TO:'to||CRLF)
call recvline(sock,"BUFF",256)
if left(BUFF,3)=='250' then /* can't remember the correct resp */
do /* code, find it yourself :P */
call send(sock,'DATA'CRLF)
call recvline(sock,"BUFF",256)
if left(BUFF,3)=='354' then
do
call send(sock,body)
call send(sock,CRLF||'.'||CRLF)
sent=1
end
end
end
end
call send(sock,'QUIT'CRLF)
end
call closesocket(sock)
end
return sent
Do the header stuff yourself :P
Regards
Tom
--------------------------- ONElist Sponsor ----------------------------
GET A NEXTCARD VISA, in 30 seconds. Get rates as low as 0.0 percent
Intro APR and no hidden fees. Apply NOW.
<a href=" http://clickme.onelist.com/ad/NextcardCreativeCL ">Click Here</a>
------------------------------------------------------------------------
ARexx mailing list - No flames, no overquoting, no crossposting. Unsubscribe: Blank mail to mailto:arexx-unsubscribe@onelist.com