Author Topic: Send email from commandline (actually a rexx script)  (Read 15464 times)

Jan-Erik Lärka

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 275
  • Karma: +5/-0
    • View Profile
Send email from commandline (actually a rexx script)
« on: December 13, 2014, 01:20:55 pm »
Hello,

What tool is available to send emails from command line?

I've created a quite large script that at the end has to reply to 12 e-mail addresses.
The text in the body has to contain national characters such as å, ä and ö and a png image (each different) as attachement.

1. PMMail run a filter that detect a certain file from a certain sender
2. PMMail launch my rexx script
3. My rexx script use a python script to convert the xlsx-file into a csv-file
4. My rexx script interpret the file and get the coordinates of addresses from google (maps api) specified in the csv-file
5. My rexx script write 1 + 4 × 10 different files based on areas, contacting info, misspelled addresses etc.
6. My rexx script start an OpenOffice .ods file that use a series of macros to (among other things) export 12 charts to a ftp-server through netdrive.
7. My rexx script should send an email to give a brief update and notify each person about the current status and attach a chart (png image) exported from the .ods-file by the macros to show how far they've come.

Suggestions?

No, PMMSend remove å, ä and ö, so it has to be fixed first.
Yes, they fixed the = ? encoding problem yesterday.

Ohh, yes, I need the solution up and running by tomorrow (Sunday 14 December 2014)  :P

Regards,
//Jan-Erik

Olafur Gunnlaugsson

  • Full Member
  • ***
  • Posts: 244
  • Karma: +5/-0
    • View Profile
Re: Send email from commandline (actually a rexx script)
« Reply #1 on: December 13, 2014, 01:35:24 pm »
RexxMail?

There was also WebMail/2, the later versions were compartmentalised enough so you might be able to rip off some of the scripts used, I recall that the last versions never showed up on hobbes and I had to get them off archive.org

Jan-Erik Lärka

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 275
  • Karma: +5/-0
    • View Profile
Re: Send email from commandline (actually a rexx script)
« Reply #2 on: December 13, 2014, 05:45:11 pm »
Tried RexxMail before I wrote here, but it has limitations (secure transfer through stunnel doesn't work?) and seem very focused on doing things by hand.

I use webmail/2 on my web server, but I don't know if it can work through stunnel and there are some problems with it so I had to rewrite it to support UTF-8 encoded emails, html-email and Windows users... that broke my version of it.  :-\

Regards,
Jan-Erik

Jan-Erik Lärka

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 275
  • Karma: +5/-0
    • View Profile
Re: Send email from commandline (actually a rexx script)
« Reply #3 on: December 13, 2014, 05:47:33 pm »
Any command line executable?

Andi B.

  • Hero Member
  • *****
  • Posts: 811
  • Karma: +11/-2
    • View Profile
Re: Send email from commandline (actually a rexx script)
« Reply #4 on: December 13, 2014, 08:36:54 pm »
Did you ever look at weasel? AFAIR you only have to put the emails into forward directory and wait till weasel picks it up. Or start the sendq.cmd to immediately trigger sending. Think such procedure is even described in the bundled documentation but never used by myself.

Of course this needs to setup a complete email server (weasel) but that's not to hard as even I've running it since years ;-)

Jan-Erik Lärka

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 275
  • Karma: +5/-0
    • View Profile
Re: Send email from commandline (actually a rexx script)
« Reply #5 on: December 13, 2014, 11:48:47 pm »
Thank you for your suggestions.

I'm trying to figure out RexxMail but will also look into Weasel.

I have Weasel, but need to use a specific server to handle the emails, so I don't know how to handle that.

//Jan-Erik

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1593
  • Karma: +4/-2
    • View Profile
Re: Send email from commandline (actually a rexx script)
« Reply #6 on: December 13, 2014, 11:55:37 pm »
Quote
No, PMMSend remove å, ä and ö, so it has to be fixed first.

Check the PMMail FTP site. The latest version (just updated) works, for me.

Quote
Did you ever look at weasel?

That won't help. The e-mail needs to be properly created so that weasel can send them correctly. No editing is done by weasel, other than to add appropriate header lines. If the message is incorrect, it will be sent with the error.

Jan-Erik Lärka

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 275
  • Karma: +5/-0
    • View Profile
Re: Send email from commandline (actually a rexx script)
« Reply #7 on: December 14, 2014, 01:48:18 am »
Hello,

I can inform you that James Moe and Doug Bissett, OS2VOICE, fixed PMMSend in lightning speed so that it can behave well with national characters that I need to use. Thank you James and Doug!

 :D

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1593
  • Karma: +4/-2
    • View Profile
Re: Send email from commandline (actually a rexx script)
« Reply #8 on: December 14, 2014, 07:09:32 am »
Quote
I can inform you that James Moe and Doug Bissett, OS2VOICE, fixed PMMSend in lightning speed

James does the hard work, I just do the testing, and try to collect the information that he needs to do his job.

I will take this opportunity to mention that ALL of the PMMail development is done by unpaid volunteers (almost all by James Moe). Some of the proceeds from PMMail go toward maintaining the VOICE web site http://www.os2voice.org/. The rest goes toward other projects that benefit the OS/2 community. VOICE is a non profit organization.