• E-mail / SMTP

    From Raiko@21:1/5 to All on Thu May 2 07:39:10 2019
    I'd like to automate sending e-mails with attachment from a Rexx program I have created, (classic REXX, OS/2).

    Does anyone have code sample to login/authenticate to a smtp-server, fill in subject, to/from, some email-text and attach a file?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Garry Smithwick@21:1/5 to Raiko on Fri May 3 05:27:03 2019
    On Thursday, May 2, 2019 at 10:39:12 AM UTC-4, Raiko wrote:
    I'd like to automate sending e-mails with attachment from a Rexx program I have created, (classic REXX, OS/2).

    Does anyone have code sample to login/authenticate to a smtp-server, fill in subject, to/from, some email-text and attach a file?

    You can use the SendEmail.exe program. Here is an example of using SendEmail to send via gmail:

    Address Command 'SendEmail.exe' '-s smtp.gmail.com:587 -xu' user '-xp' pass '-o tls=yes' attachment '-f' from '-t' SendTo '-u' '"'subject'"' TextAppend


    Download SendEmail from here:

    http://caspian.dotconf.net/menu/Software/SendEmail/

    -a file
    -cc
    -bcc
    -l logfile
    -v -- verbosity
    -q -- quiet

    -o message-content-type=<auto|text|html>
    -o message-file=file
    -o reply-to=address
    -o username=username



    There are other email exe's if you search.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Raiko@21:1/5 to All on Fri May 3 06:41:59 2019
    SendEmail seems to be a good tool, but OS/2 is not listed as a supported platform. (OS/2 comes with it's own sendmail.exe but it's not an option in this case.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Derek J Decker@21:1/5 to Raiko on Fri May 3 14:54:13 2019
    On Thu, 02 May 2019 07:39:10 -0700, Raiko wrote:

    I'd like to automate sending e-mails with attachment from a Rexx program
    I have created, (classic REXX, OS/2).

    Does anyone have code sample to login/authenticate to a smtp-server,
    fill in subject, to/from, some email-text and attach a file?

    This could be done completely in REXX, I don't have any sample code handy
    for this, though.

    However, I've used mpack in OS/2 (and now, Linux) for years to send email messages with attachments from the command line on a regular basis. It
    would be simple to call this from an OS/2 Classic Rexx program - you
    could be done this afternoon.

    From the man file, the syntax is :

    mpack [ -a ] [ -s subject ] [ -d descriptionfile ] [ -m maxsize ]
    [ -c content-type ] file address ...


    Mpack is still available on Hobbes -

    <http://hobbes.nmsu.edu/h-viewer.php?dir=/pub/os2/util&file=mpack15o.zip>

    I haven't set this up on OS/2 in a long time - I believe you'll have to
    have a working SMTP server on your OS/2 machine set to relay email to the proper external servers. Back in the day, I used weasel for this -

    <http://hobbes.nmsu.edu/h-viewer.php?dir=/pub/os2/apps/internet/mail/ server&file=weasel_2.5.zip>

    Much easier to setup than the old sendmail.

    Hope this was helpful,

    -Derek

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nospam_2019@efbe.prima.de@21:1/5 to All on Fri May 3 16:55:24 2019
    Am 03.05.19 um 15:41 schrieb Raiko:
    SendEmail seems to be a good tool, but OS/2 is not listed as a supported platform. (OS/2 comes with it's own sendmail.exe but it's not an option in this case.)

    For OS/2 you can use pmmsend.exe from PMMail.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Derek J Decker@21:1/5 to Raiko on Fri May 3 15:54:38 2019
    On Fri, 03 May 2019 08:26:13 -0700, Raiko wrote:

    Thanks for suggestions, will have a look at both Mpack and PMMail.

    Still, out of personal interest, I'd like to see the Rexx code needed
    for this task.

    I haven't tested these personally, but OK. This would be how to do it the
    hard way.

    OK, you're sending an email with an attachment. First, this attachment
    will have to be encoded, either UUENCODE or Base64.

    <http://hobbes.nmsu.edu/h-viewer.php?dir=/pub/os2/dev/
    rexx&file=base64.zip>

    is an example REXX program that will do the encode.

    The encoded block of text for the attachment will have to be combined
    with the text of the email in proper MIME/multipart format. This is just
    text manipulation, straightforward with REXX,you'll have to look at the
    MIME RFCs to see how that should look. Mpack saves you all this trouble,
    can also be used to write an output file as an example of what the email
    should look like raw.

    Once your email with attachment is MIME formatted properly, you'll want
    to send it out via SMTP to a trusted server. Here's an article with
    example code that purports to so this:

    <http://www.edm2.com/index.php/ Send_Mail_to_an_Email_List_with_REXX,_SMTP_and_Sockets>

    A local SMTP server or pmmsend.exe would save you the trouble here.


    Those would eb most of the parts you'd need.

    Have fun!

    -Derek

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Raiko@21:1/5 to All on Fri May 3 08:26:13 2019
    Thanks for suggestions, will have a look at both Mpack and PMMail.

    Still, out of personal interest, I'd like to see the Rexx code needed for this task.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Small@21:1/5 to Raiko on Sat May 4 13:15:17 2019
    On Thu, 2 May 2019 14:39:10 UTC, Raiko <per@raiko.no> wrote:

    I'd like to automate sending e-mails with attachment from a Rexx program I have created, (classic REXX, OS/2).

    Does anyone have code sample to login/authenticate to a smtp-server, fill in subject, to/from, some email-text and attach a file?

    Another possibility for this would be RexxMail. It has both a WPS and
    command line interface (the latter for your needs).

    It can be downloaded from: <http://www.os2site.com/sw/internet/mail/client/rexxmail/rexxmail_2006 1224_155329.zip>

    --

    John Small

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From igorpool2012@gmail.com@21:1/5 to All on Wed May 29 13:37:37 2019
    Hi,

    I wrote a REXX function package many called rexxweb that will allow sending of e-mails including attachments by a REXX script.

    There are 60+ functionsin the library which I developed when I use to use REXX for cgi based websites.

    Its available on hobbes.nmsu.edu

    Search for rxweb151.zip

    Cheers,

    Igor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)