Author Topic: Rexx Socket / SMTP  (Read 15019 times)

Per E. Johannessen

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +3/-0
    • View Profile
Rexx Socket / SMTP
« on: May 03, 2019, 04:07:06 pm »
Hi,

I'd like to automate sending e-mails with a file attached from an application I've created with VX-Rexx.  Since I have no experience using Rexx Sockets I'd appreciate help/ sample of how to:
Initialize sockets
Log-in to smtp server
Attach file
Send message

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1593
  • Karma: +4/-2
    • View Profile
Re: Rexx Socket / SMTP
« Reply #1 on: May 03, 2019, 04:25:57 pm »
PMMail has the PMMSEND utility to do things like that.

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #2 on: May 03, 2019, 05:01:45 pm »
Hi Per

No idea myself - but if I need to know I would start looking in Rexx Tips and Tricks Version 3.60 which informs me there are/were various libraries available to help with connectivity.

Maybe this rxsock INF file will be of help http://hobbes.nmsu.edu/download/pub/os2/dev/rexx/rxsock.zip


Regards

Pete

Andreas Schnellbacher

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #3 on: May 03, 2019, 05:39:17 pm »
You can also look at how Marcus de Geus did that in RexxMail. IIRC, attachments have to be base64-encoded, but I don't know how they are appended to the message text.

It looks like a lot of work, so using PMMail or one of the older Mozilla add-ons might be easier.

Bogdan

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +1/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #4 on: May 03, 2019, 06:23:03 pm »
IIRC, attachments have to be base64-encoded,[
Quote
Not true, even for old-school SMTP.

Quote
but I don't know how they are appended to the message text.
Please take a look at MIME.

RXHELO which utilises RXSOCK is a good starting point, but nowadays authentication features should be considered unless you're running an MTA for in-house operations.

Per E. Johannessen

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +3/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #5 on: May 03, 2019, 08:32:42 pm »
For now I think I'll go for the PMMSEND utility.

Still, I'd like to learn how do it with RxSock.

"RXHELO which utilises RXSOCK is a good starting point"

Is RXHELO a library?
Or do you mean RXHELO as a term for the connection/authentication commands between the client and the smtp server?

Found somewhere a link to rxhelo.cmd, but unfortunately the link was not available anymore.

Andreas Schnellbacher

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #6 on: May 03, 2019, 09:47:11 pm »
I've found another example written in REXX: John Small's ReleaseTool.cmd of FM/2. See the fm2/trunk source directory. It's much shorter than RexxMail.cmd, but regarding emails, it's only able to send them.
« Last Edit: May 03, 2019, 11:06:04 pm by Andreas Schnellbacher »

Tom

  • Full Member
  • ***
  • Posts: 194
  • Karma: +5/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #7 on: May 03, 2019, 11:10:42 pm »
Found somewhere a link to rxhelo.cmd, but unfortunately the link was not available anymore.

Have you tried that link on www.archive.org ? Maybe the target of that link is saved there.

Per E. Johannessen

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +3/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #8 on: May 04, 2019, 12:59:16 am »
Found somewhere a link to rxhelo.cmd, but unfortunately the link was not available anymore.

Have you tried that link on www.archive.org ? Maybe the target of that link is saved there.

It took me to an "archive-site" but got msg that it was unavailable

Per E. Johannessen

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +3/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #9 on: May 04, 2019, 01:02:42 am »
I've found another example written in REXX: John Small's ReleaseTool.cmd of FM/2. See the fm2/trunk source directory. It's much shorter than RexxMail.cmd, but regarding emails, it's only able to send them.

Logged in but still I get "no permission" when I try to read the file.

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 1024
  • Karma: +24/-0
    • View Profile
    • Blonde Guy
Re: Rexx Socket / SMTP
« Reply #10 on: May 04, 2019, 01:39:43 am »
I just did this myself.

Get Weasel and the extra tool qmail. Qmail.cmd is a rexx script to send e-mails. It uses Weasel to actually send. I'm also using STunnel to do the SSL because my ISP requires secure e-mail.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Alex Taylor

  • Sr. Member
  • ****
  • Posts: 387
  • Karma: +5/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #11 on: May 04, 2019, 04:13:25 am »
It's not SMTP, but my IMAPADD script demonstrates how to use IMAP via REXX to add a message to the remote mail server.
http://www.altsan.org/programming/rexx/index.html#imapadd

I used to use it to have PMMail copy all incoming messages to my IMAP account.

Andreas Schnellbacher

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #12 on: May 04, 2019, 12:19:40 pm »
I've found another example written in REXX: John Small's ReleaseTool.cmd of FM/2. See the fm2/trunk source directory. It's much shorter than RexxMail.cmd, but regarding emails, it's only able to send them.

Logged in but still I get "no permission" when I try to read the file.
You seem to have tried the trac browser on netlabs.org. It works in some cases, but never for .cmd files. Browsing works reliable via this URL: http://svn.netlabs.org/repos/fm2/trunk/

For both trac and the web server browser, you don't have to log in.

Per E. Johannessen

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +3/-0
    • View Profile
Re: Rexx Socket / SMTP
« Reply #13 on: May 06, 2019, 09:49:43 pm »
Have found various "rexx-sendmail-programs" but none of them can be used since they don't support SSL.

Tried PMMail, which receives mail ok, but unable to send. It has lots of configuration options so most likely
I have not set it up right, (so can't use PMMSEND for now).
(Smtp configuration in Seamonkey is easy and works fine.)

Some more searching lead me to:

https://sourceforge.net/projects/rexxcurl/files/rexxcurl/2.0/rexxcurl20os2_RexxTrans.zip/download

Seems like rexxcurl supports SSL and is the right tool.




Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Rexx Socket / SMTP
« Reply #14 on: May 07, 2019, 12:40:05 am »