Email attachments using U2 and AIX

114 views
Skip to first unread message

Scott Johnston

unread,
Feb 21, 2012, 4:57:05 PM2/21/12
to mvd...@googlegroups.com
Hey does anyone have a bit of code to create an email with an attachment using U2 and AIX?  I've seen it before at another job it's not much about 75 lines with a couple of low level unix calls.

Let me know if you know what code I'm talking about. I need some way to email attachments using unix

Thanks!

Nathan Rector

unread,
Feb 21, 2012, 5:01:09 PM2/21/12
to mvd...@googlegroups.com
Scott,

Check these articles out:

http://www.intl-spectrum.com/resource/category/67/Email.aspx


-Nathan

> --
> You received this message because you are subscribed to
> the "Pick and MultiValue Databases" group.
> To post, email to: mvd...@googlegroups.com
> To unsubscribe, email to: mvdbms+un...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms

--
Nathan Rector
International Spectrum, Inc
http://www.intl-spectrum.com
Phone: 720-259-1356
Fax: 603-250-0664

Twitter: http://twitter.com/intlspectrum
Facebook: http://intl-spectrum.com/facebook

Scott Ballinger

unread,
Feb 21, 2012, 5:23:42 PM2/21/12
to Pick and MultiValue Databases
Scott,

Postie is a command line email client that can send attachments, etc.
It can also query your POP3 or IMAP email account and download emails,
move messages amongst IMAP folders, delete and forward messages, etc.

http://www.infradig.com/

I think the commercial version is only $75 US. It is super robust and
works great. Sure you could roll your own, but I guarantee you will
spend way more than $75 of your time getting to work reliably.

Contact the developer, Andrew Davison at sup...@infradig.com for more
info.

Highly recommended!

/Scott Ballinger
Pareto Corporation
Edmonds WA USA

On Feb 21, 2:01 pm, Nathan Rector <nat...@intl-spectrum.com> wrote:
> Scott,
>
> Check these articles out:
>
> http://www.intl-spectrum.com/resource/category/67/Email.aspx
>
> -Nathan
>
> On 2/21/2012 2:57 PM, Scott Johnston wrote:
>
> > Hey does anyone have a bit of code to create an email with an attachment
> > using U2 and AIX? I've seen it before at another job it's not much about
> > 75 lines with a couple of low level unix calls.
>
> > Let me know if you know what code I'm talking about. I need some way to
> > email attachments using unix
>
> > Thanks!
>
> > --
> > You received this message because you are subscribed to
> > the "Pick and MultiValue Databases" group.
> > To post, email to: mvd...@googlegroups.com
> > To unsubscribe, email to: mvdbms+un...@googlegroups.com
> > For more options, visithttp://groups.google.com/group/mvdbms
>
> --
> Nathan Rector
> International Spectrum, Inchttp://www.intl-spectrum.com

Tony Gravagno

unread,
Feb 21, 2012, 6:22:48 PM2/21/12
to mvd...@googlegroups.com
[AD]
 
Homegrown solutions are great.  They're free, rely on open source, they're fun to code, and after you get what you want done it just feels wonderful.  As Nathan indicated, you can even get all the info you need to DIY right from Spectrum Magazine.  The problem is that only one person knows how they work, and that person forgets about a week after leaving the code.  The code is usually "write-only", or virtually unreadable by anyone, including the author, after it's written.
 
NebulaMail is pure BASIC as far as the developer is concerned, with no need to understand how underlying tools work.  It supports all common features and a lot of not-so common ones, all using familiar VAR<NAME>="value" syntax.  (It works just like NebulaXLite.)  These features include converting addresses to standard format, support for Organization, ReplyTo, and custom headers, priority, multiple attachments, simultaneous text and HTML so that clients get your message no matter how they're reading it, embedded images, and multiple server types including SMTP and QMail.  It supports a well-defined configuration file that stores template details, so each mail item or batch can use a different server, from/to combination, or other details you don't need to code yourself.
 
NebulaMail is built over PHPMailer (FOSS), just like anyone here would create a DIY solution, but it's a full implementation, elegant, and it works across all MV and OS platforms (wherever PHPMailer works).  I've done the work so you don't have to.  Do you want to spend time coding an email client, or do you really need to spend time getting your application to send email?  Those are vastly different concepts.  How much is your time worth?
 
In summary, there are a bunch of great reasons to DIY, but there are a lot of reasons Not to DIY too.  Check out NebulaMail.  It follows the same licensing as for NebulaXLite - free for developers and only $200 with free support and upgrades for end-users in production mode.  (Please be prepared for short delays where the code needs to be ported to previously unsupported systems.  PHPMailer must be installed and running on the target system before NebulaMail is installed.)
 
Thanks.
Tony Gravagno
Nebula Research and Development
(where it says remove.please ... remove that .... please)
 


From: Scott Johnston

Don Robinson

unread,
Feb 22, 2012, 12:00:50 AM2/22/12
to mvd...@googlegroups.com
Scott,

What you are thinking about might be uuencode. I EXECUTE it from Universe basic on AIX.
You just pipe it's output to mail in the same execute and that's it.
I don't know what the limit is on attachment size but we haven't had a problem with it.
 
DonR

--- On Tue, 2/21/12, Scott Johnston <talo...@gmail.com> wrote:

Lloyd Cottrell

unread,
Feb 22, 2012, 12:09:27 AM2/22/12
to mvd...@googlegroups.com
Just download mutt

Sent from my iPad
--

Symeon Breen

unread,
Feb 22, 2012, 4:51:38 AM2/22/12
to mvd...@googlegroups.com

On linux you can use mutt or mail – they come out of the box, I think they come for aix, if not it will have some form of command line mail in there somewhere, unix had mail way before windows ….

 

 

 

From: mvd...@googlegroups.com [mailto:mvd...@googlegroups.com] On Behalf Of Scott Johnston
Sent: 21 February 2012 21:57
To: mvd...@googlegroups.com
Subject: [mvdbms] Email attachments using U2 and AIX

 

Hey does anyone have a bit of code to create an email with an attachment using U2 and AIX?  I've seen it before at another job it's not much about 75 lines with a couple of low level unix calls.

 

Let me know if you know what code I'm talking about. I need some way to email attachments using unix

 

Thanks!

--

You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms


No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1424 / Virus Database: 2113/4823 - Release Date: 02/21/12

David Hendershot

unread,
Feb 22, 2012, 9:07:47 AM2/22/12
to Pick and MultiValue Databases
Here is a unix command you could execute from a program:

EXECUTE \SH -c "(echo 'this is the body';uuencode /path/filename
filename) | mailx -m -s 'this is the subject'" em...@gmail.com\

This works for me and I am on HPUX/UniVerse. I believe if the
filename is over 10MB you will have a problem and probably have to
compress it first. Feel free to email me if you need any clarification
on the syntax

Scott Johnston

unread,
Feb 22, 2012, 10:30:15 AM2/22/12
to mvd...@googlegroups.com
Hey Don, is your solution similar to  David Hendershot's  below?

David Hendershot

unread,
Feb 22, 2012, 10:58:18 AM2/22/12
to Pick and MultiValue Databases
I just looked this over again and realized I placed the second double
quote in the wrong spot. It should be directly after the email
address (but before the '\') not after the subject.

On Feb 22, 9:07 am, David Hendershot <davidhendersho...@gmail.com>
wrote:

Don Robinson

unread,
Feb 22, 2012, 4:06:01 PM2/22/12
to mvd...@googlegroups.com
Scott,
 
Yes, here's mine.

COMMAND  = \SH -c 'uuencode \: FILE.PATH: \ \: FIELD(FILE.PATH,'/',5): \ | mail -s \:SUBJECT:\ \:EMAIL.ADDR: \'\
This doesn't include a message body, Davids does.
Subject needs double quotes  around the data to avoid problems with spaces.
FILE.PATH is the full path to the attachment.
The FIELD(... ) should be done prior to this statement, I must have gotten lazy! The 5 only works if there are 4 slashes (/) in the file path which may be different for you.

Don

--- On Wed, 2/22/12, Scott Johnston <talo...@gmail.com> wrote:

uiterwyk

unread,
Feb 22, 2012, 5:26:39 PM2/22/12
to Pick and MultiValue Databases
Scott,

I will forward a routine I have used in D3 and jBase for a long time
to send
using sendmail (rather than mutt). I am not sure it is original by
me, or I would publish it here.

It handles both plain-text and html with/without attachments. (using
the linux mpack command for attachments)

HTH,

Robert

Jan Van Schalkwyk

unread,
Feb 23, 2012, 2:44:19 AM2/23/12
to mvd...@googlegroups.com
Hi,

In the Windows World we use BLAT
Check it out. It's free and available at www.blat.net

Cheers

Scott Johnston

unread,
Feb 24, 2012, 4:37:36 PM2/24/12
to Pick and MultiValue Databases
Hi Robert,

Where did you send this too?

Thanks again,
Scott

uiterwyk

unread,
Feb 25, 2012, 5:12:45 PM2/25/12
to Pick and MultiValue Databases
Your Talon----@gmail account,

Otherwise send me an email direct to rob3rt(at)u1t3rwyk(dot)net
(changing numbers to letters as appropriate)

Robert

John Thompson

unread,
Feb 27, 2012, 7:50:02 AM2/27/12
to Pick and MultiValue Databases
We setup a linux machine alongside of our UV AIX system. Getting ssl
to work on AIX is a career in and of itself.

We put mutt on it:
http://www.mutt.org/

Then we put msmtp on it, to avoid all of the sendmail setup nonsense.
It even works with ssl email servers like google apps for business,
etc.
http://msmtp.sourceforge.net/

Edit a few config files and just send remote ssh commands over to the
linux machine to send any document you want.
You can use samba, or ftp (which is more crude), to share the files
between the two machines.

Its not fancy, but, it gets the job done in a pinch. Tony's product
sounds nice. I should really give some of his stuff a visit one day
if I ever get my head above water...

Of course, its like the old gospel song says, "If you tarry till
you're better, you'll never come at all"

Anyway, you can email me at (jthompson333 at gmail dot com) if you
want. I think I have some good notes written up on the whole mutt
smtp thing.
Reply all
Reply to author
Forward
0 new messages