Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending email from BASIC?

0 views
Skip to first unread message

Alan Adams

unread,
Sep 27, 2009, 5:01:29 PM9/27/09
to
I am wondering whether is a way to send email from a BASIC program. I
would be running the (as yet hypothetical) program on an Iyonix which
has Messenger Pro server running, and also WebJames with hmail
(although whenever I've tried to use hmail, WebJames stalls).

I'm thinking about a process run once a week which mails current
information out to a list of people, where both the information and
the list are updated by other means. Presumably I can kick the process
off from Alarm.

--
Alan Adams, from Northamptonshire
al...@adamshome.org.uk
http://www.nckc.org.uk/

Ian Hamilton

unread,
Sep 28, 2009, 3:23:03 AM9/28/09
to
In article <55b487a150...@laptop.adamshome.org.uk>,

Alan Adams <al...@adamshome.org.uk> wrote:
> I am wondering whether is a way to send email from a BASIC program. I
> would be running the (as yet hypothetical) program on an Iyonix which
> has Messenger Pro server running, and also WebJames with hmail
> (although whenever I've tried to use hmail, WebJames stalls).

All you have to do is create the appropriate files in the mail sender's
queues. e.g. Hermes would be <Hermes$MailDir>.mailout.work (Envelope) and
<Hermes$MailDir>.mailout.text (Email).

> I'm thinking about a process run once a week which mails current
> information out to a list of people, where both the information and
> the list are updated by other means. Presumably I can kick the process
> off from Alarm.

Yes. If you want them sent immediatedly then trigger the mail sender too
e.g. Hermes would be either '*Hermes_Send' or '*Hermes_FetchAndSend'.

Ian

--
Ian Hamilton (Iyonix RO5) http://www.hamiltoni.pwp.blueyonder.co.uk/

Alan Wrigley

unread,
Sep 28, 2009, 7:23:21 AM9/28/09
to
Ian Hamilton <Ian.Ha...@AAUG.net> wrote:

> In article <55b487a150...@laptop.adamshome.org.uk>,
> Alan Adams <al...@adamshome.org.uk> wrote:
> > I am wondering whether is a way to send email from a BASIC program. I
> > would be running the (as yet hypothetical) program on an Iyonix which
> > has Messenger Pro server running, and also WebJames with hmail
> > (although whenever I've tried to use hmail, WebJames stalls).
>
> All you have to do is create the appropriate files in the mail sender's
> queues. e.g. Hermes would be <Hermes$MailDir>.mailout.work (Envelope) and
> <Hermes$MailDir>.mailout.text (Email).

Hermes 2.50 has an API for sending mail directly from your own applications.

Alan

--
RISC OS - you know it makes cents

Rob Kendrick

unread,
Sep 28, 2009, 7:35:30 AM9/28/09
to
On Sun, 27 Sep 2009 22:01:29 +0100
Alan Adams <al...@adamshome.org.uk> wrote:

> I am wondering whether is a way to send email from a BASIC program. I
> would be running the (as yet hypothetical) program on an Iyonix which
> has Messenger Pro server running, and also WebJames with hmail
> (although whenever I've tried to use hmail, WebJames stalls).

For simple things, SMTP is not difficult to speak. There are a handful
of command line tools from UNIX that will send an email that could be
ported using GCCSDK. These would require your program to be given SMTP
smarthost server details, etc.

I don't know if Gavin Wraith's excellent port of Lua has LuaSocket, but
LuaSocket has a glorious and easy-to-use way of sending emails via
SMTP, which is incredibly handy for writing automation and reporting
scripts; I've already written two today.

B.

Alan Adams

unread,
Sep 28, 2009, 1:47:56 PM9/28/09
to
In message <gemini.kqoiax000984c02n0.spamhater@keepyourfilthyspamtoyou
rself.co.uk>
Alan Wrigley <spam...@keepyourfilthyspamtoyourself.co.uk>
wrote:

> Ian Hamilton <Ian.Ha...@AAUG.net> wrote:

> Alan

That's useful. How do I find the documentation? It's not on the
floppy.

Alan Wrigley

unread,
Sep 28, 2009, 5:19:24 PM9/28/09
to
Alan Adams <al...@adamshome.org.uk> wrote:

> In message <gemini.kqoiax000984c02n0.spamhater@keepyourfilthyspamtoyou
> rself.co.uk>
> Alan Wrigley <spam...@keepyourfilthyspamtoyourself.co.uk>
> wrote:
> > Hermes 2.50 has an API for sending mail directly from your own applications.
>

> That's useful. How do I find the documentation? It's not on the
> floppy.

It should be in the !Hermes.Docs directory. There's a file called API which
documents the SWI calls, and another called DirectMail which describes how to
use it. It's only present in V2.50 and later.

James Peacock

unread,
Sep 28, 2009, 6:26:44 PM9/28/09
to
Alan Adams wrote:

> I am wondering whether is a way to send email from a BASIC program. I
> would be running the (as yet hypothetical) program on an Iyonix which
> has Messenger Pro server running, and also WebJames with hmail
> (although whenever I've tried to use hmail, WebJames stalls).

[snip]

Oddly enough, a few months ago, I was playing around with the old
NewsBase Wimp message protocol as briefly documented in StrongHelp. It
appears the backend to Messenger still supports them. I came up with
the following which may offer a starting point.

James

------------------------------------------------------------------
mail$="Ram::RamDisc0.$.Mail"

SYS"Wimp_Initialise", 310, &4B534154, "SendMail", 0 TO ,task%
DIM blk% 256

REM Register with NewsBase
blk%!0=256
blk%!12=0
blk%!16=&83580
blk%!20=0 + (1<<16)
blk%!24=0
blk%!28=0
SYS"Wimp_SendMessage",17,blk%,0

REM Send the message
blk%!0=256
blk%!12=0
blk%!16=&83580
blk%!20=310 + (1<<16)
blk%!24=0
blk%!28=0
$(blk%+32)=mail$+CHR$0+"-"+CHR$0
SYS"Wimp_SendMessage",17,blk%,0

REM Deregister with NewsBase
blk%!0=256
blk%!12=0
blk%!16=&83580
blk%!20=10 + (1<<16)
SYS"Wimp_SendMessage",17,blk%,0

SYS"Wimp_CloseDown",task%,&4B534154

Theo Markettos

unread,
Sep 29, 2009, 11:26:09 AM9/29/09
to
James Peacock <j.peaco...@googlemail.com> wrote:
> Oddly enough, a few months ago, I was playing around with the old
> NewsBase Wimp message protocol as briefly documented in StrongHelp. It
> appears the backend to Messenger still supports them. I came up with
> the following which may offer a starting point.

It doesn't help this problem, as it's only 26 bit, but Justin Fletcher's
gmail [1] will also handle sending to lots of different transports. It's
designed to be used something like:

*gmail -s "Subject" -t some...@example.com "Hello world"

Theo

[1] Which existed quite a long time before and is nothing to do with
Google's namesake.

Alan Adams

unread,
Sep 29, 2009, 3:13:11 PM9/29/09
to
In message <gemini.kqp9wc000hs480318.spamhater@keepyourfilthyspamtoyou

> Alan Adams <al...@adamshome.org.uk> wrote:

>> In message <gemini.kqoiax000984c02n0.spamhater@keepyourfilthyspamtoyou
>> rself.co.uk>
>> Alan Wrigley <spam...@keepyourfilthyspamtoyourself.co.uk>
>> wrote:
>>> Hermes 2.50 has an API for sending mail directly from your own
>>> applications.
>>
>> That's useful. How do I find the documentation? It's not on the
>> floppy.

> It should be in the !Hermes.Docs directory. There's a file called API which
> documents the SWI calls, and another called DirectMail which describes how to
> use it. It's only present in V2.50 and later.

That explains it - I'm on 2.20

hum... Have I got an update waiting to be installed? I'll see.

> Alan

Alan Wrigley

unread,
Sep 29, 2009, 4:00:01 PM9/29/09
to
Alan Adams <al...@adamshome.org.uk> wrote:

> In message <gemini.kqp9wc000hs480318.spamhater@keepyourfilthyspamtoyou
> rself.co.uk>
> Alan Wrigley <spam...@keepyourfilthyspamtoyourself.co.uk>
> wrote:
>
> > Alan Adams <al...@adamshome.org.uk> wrote:
>
> >> In message <gemini.kqoiax000984c02n0.spamhater@keepyourfilthyspamtoyou
> >> rself.co.uk>
> >> Alan Wrigley <spam...@keepyourfilthyspamtoyourself.co.uk>
> >> wrote:
> >>> Hermes 2.50 has an API for sending mail directly from your own
> >>> applications.
> >>
> >> That's useful. How do I find the documentation? It's not on the
> >> floppy.
>
> > It should be in the !Hermes.Docs directory. There's a file called API which
> > documents the SWI calls, and another called DirectMail which describes how
to
> > use it. It's only present in V2.50 and later.
>
> That explains it - I'm on 2.20
>
> hum... Have I got an update waiting to be installed? I'll see.

If it helps, the feature is quite comprehensive and enables you to specify
multiple recipients, add your own headers and send attachments. The latest
version of Datapower also has script enhancements to send mail directly from a
database.

Ian Hamilton

unread,
Sep 30, 2009, 3:28:26 AM9/30/09
to
In article
<gemini.kqr0w100pl...@keepyourfilthyspamtoyourself.co.uk>,

Alan Wrigley <spam...@keepyourfilthyspamtoyourself.co.uk> wrote:
> Alan Adams <al...@adamshome.org.uk> wrote:

> > In message <gemini.kqp9wc000hs480318.spamhater@keepyourfilthyspamtoyou
> > rself.co.uk>
> > Alan Wrigley <spam...@keepyourfilthyspamtoyourself.co.uk>
> > wrote:
> >
> > > Alan Adams <al...@adamshome.org.uk> wrote:
> >
> > >> In message <gemini.kqoiax000984c02n0.spamhater@keepyourfilthyspamtoyou
> > >> rself.co.uk>
> > >> Alan Wrigley <spam...@keepyourfilthyspamtoyourself.co.uk>
> > >> wrote:
> > >>> Hermes 2.50 has an API for sending mail directly from your own
> > >>> applications.

[Snip]

> > > It should be in the !Hermes.Docs directory.

Is the API online anywhere?

> > That explains it - I'm on 2.20

> If it helps, the feature is quite comprehensive and enables you to


> specify multiple recipients, add your own headers and send attachments.
> The latest version of Datapower also has script enhancements to send
> mail directly from a database.

Does it always create mail into a Hermes queue or is there an option to
create elsewhere? In other words, can the mail be deferred somehow?

0 new messages