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

Sending e-mail from D3 through the Linux server

29 views
Skip to first unread message

Ricky Ginsburg

unread,
Aug 8, 2008, 10:26:22 AM8/8/08
to
I have been using Blat on the client side of all my systems (Windows
workstations) to handle D3 e-mail processing. However, several users at
various sites are using Mac's for their workstations. Is there a way to have
a Linux server send e-mails from HTML files created in D3?

D3Linux 7.4.0 running on RedHat 9.

Thanks.

--
Ricky Ginsburg

Have you seen Ricky's new website?
http://www.fawnridge.com/ricky


dbene...@gmail.com

unread,
Aug 8, 2008, 1:52:19 PM8/8/08
to

Search the group for "SMTPSEND"

This is a fully Pick based little email program that my boss found and
I tweaked for our purposes.

With a little thought, (I had some at one point) I was able to send
mail with an HTML attachment. I had to do some research on how to
make a mail message see an attachment. In the end it wasn't hard.
The toughest part for me was finding the information.

Other methods is to write the file from Pick into a known file on the
Linux side and then use Linux's metasend.

A caveat here!!! With the latest licensing scheme from RD/TD or
whatever they are calling themselves, the first option will consume a
licensed seat when sending the mail.

hth
Dale

GlenB

unread,
Aug 8, 2008, 4:15:29 PM8/8/08
to
I wrote the ETK(e-mail toolkit) and SMTPSEND eons ago and things have
changed since then in D3. If you want a D3 subroutine to send e-mail
directly from D3, I can post code that I've used in the near past along with
MIME envelope examples. Your best bet on the client is to use the sendmail
tool or a MUA like mutt. If you decide to use sendmail you will need to put
the HTML either as in-line or attachment disposition in a MIME part. If the
client has a MUA like Thunderbird, you can script the e-mail from the
command line. I don't use it so I can't provide an example immediately.

GlenB

<dbene...@gmail.com> wrote in message
news:f64625a8-a35d-4bcc...@o40g2000prn.googlegroups.com...

Ricky Ginsburg

unread,
Aug 8, 2008, 7:04:46 PM8/8/08
to
Glen - Are you familiar with how Blat works? I create a temp file in HTML
and then execute Blat from within D3 to e-mail the file I've created. Is
what you've described a similar solution?

--
Ricky Ginsburg

Have you seen Ricky's new website?
http://www.fawnridge.com/ricky

"GlenB" <batchelg...@bellsouth.net> wrote in message
news:2M1nk.7570$De7....@bignews7.bellsouth.net...

Rookie

unread,
Aug 9, 2008, 3:29:11 PM8/9/08
to
I have a simple D3 subroutine that creates a Mutt command line and
then executes it. It worked using RH6.2\D37.2 and works with
RHEL5\D37.5.
Steve

Ricky Ginsburg

unread,
Aug 9, 2008, 3:57:49 PM8/9/08
to
Steve - That sounds like what I'm looking for. Can you e-mail me the source
as a .txt file, please?
rickyg at fawnridge dot com

Thanks.

--
Ricky Ginsburg

Have you seen Ricky's new website?
http://www.fawnridge.com/ricky

"Rookie" <goo...@caspersonline.us> wrote in message
news:ce212904-f58f-4061...@c65g2000hsa.googlegroups.com...

Art

unread,
Aug 11, 2008, 10:29:52 AM8/11/08
to
On Aug 8, 7:04 pm, "Ricky Ginsburg" <ric...@fawnridge.com> wrote:
> Glen - Are you familiar with how Blat works? I create a temp file in HTML
> and then execute Blat from within D3 to e-mail the file I've created. Is
> what you've described a similar solution?
>
> --
> Ricky Ginsburg
>
I have used mutt in linux in exactly the manner your describe for
Blat.
Art

Ricky Ginsburg

unread,
Aug 11, 2008, 10:38:00 AM8/11/08
to
Art - I've got that figured out. My problem is getting it to work.
Apparently there's a problem with sendmail.mc where it's not finding a path
to send e-mail to my ISP.

--
Ricky Ginsburg

Have you seen Ricky's new website?
http://www.fawnridge.com/ricky

"Art" <artm...@triad.rr.com> wrote in message
news:5dd1f6d1-b4f7-4d15...@z72g2000hsb.googlegroups.com...

uiterwyk

unread,
Aug 11, 2008, 10:49:35 PM8/11/08
to
Ricky,

I will forward a routine I have used in D3 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


On Aug 11, 10:38 am, "Ricky Ginsburg" <ric...@fawnridge.com> wrote:
> Art - I've got that figured out. My problem is getting it to work.
> Apparently there's a problem with sendmail.mc where it's not finding a path
> to send e-mail to my ISP.
>
> --
> Ricky Ginsburg
>

> Have you seen Ricky's new website?http://www.fawnridge.com/ricky"Art" <artma...@triad.rr.com> wrote in message

Ricky Ginsburg

unread,
Aug 12, 2008, 6:37:30 AM8/12/08
to
Thanks Robert. I'll let you know when I get it.

--
Ricky Ginsburg

Have you seen Ricky's new website?
http://www.fawnridge.com/ricky

"uiterwyk" <rob...@uiterwyk.net> wrote in message
news:8ee2b8b5-9d8e-4bb1...@c58g2000hsc.googlegroups.com...

Tony Gravagno

unread,
Aug 13, 2008, 5:28:51 PM8/13/08
to
"Ricky Ginsburg" wrote:
>Is there a way to have
>a Linux server send e-mails from HTML files created in D3?

Like this?:
removepleaseNebula-RnD.com/products/mail.htm

Nah! Impossible! ;)

FWIW, the reason I wrote NebulaMail is _exactly_ because of this
situation. The Pick developer writes code and it works great for now.
Then the user asks for HTML, then for embedded images, then for
attachments, then for custom headers... If you don't want to develop
and then re-develop, ask me about NebulaMail.

Another thing to consider is that not all email clients accept email
the same way. After sending HTML emails many people decide they want
to embed images rather than linking to them. And some email clients
accept both HTML and text in the same package so that the client
software can read it regardless of how it was sent. If the email
isn't properly crafted the recipient gets the format they want but
then it looks like they have an attachment too, which is just the same
email in the other format. And yup, NebulaMail handles all of this
for you.

Now after all of that... As time permits I'm re-writing the
underpinnings of NebulaMail to include all of the features of
NebulaShip:
removepleaseNebula-RnD.com/products/ship.htm

The advantage is that a lot more features become available, including
many features unique to email clients vs sending agents like sendmail.
The difference (not a disadvantage, just different) is that NebulaMail
will now work like everything else from Nebula R&D, with the MV DBMS
sending data to a Windows middle-tier which then does all of the heavy
lifting.

Why make that shift? Well, many of you have or are going through this
now. Having ported products to SCO, Linux, AIX, HPUX, and other
platforms I've learned that hard-coding to a single platform for
immediate convenience does not translate to long-term convenience when
sites start to migrate. With NebulaMail and other offerings, the MV
software and all related BASIC code works exactly the same no matter
which DBMS or OS platform it's all running on.

HTH
T

Tony Gravagno
Nebula Research and Development
TG@ remove.pleaseNebula-RnD.com

Ross Ferris

unread,
Aug 16, 2008, 8:59:39 PM8/16/08
to
On Aug 9, 12:26 am, "Ricky Ginsburg" <ric...@fawnridge.com> wrote:
:. However, several users at
: various sites are using Mac's for their workstations. > --
: Ricky Ginsburg

Ricky,

Just picking up on this point, I'm curious - are you using some form
of "telnet" client/TE on the Mac's? Assuming that the Mac's are
"recent", and your TE allows you to execute an OS X command, what is
wrong with using the in-built (to OS X) "mail" program --> should be a
fairly minimal change to your code from what I understand ?!!

Ricky Ginsburg

unread,
Aug 17, 2008, 7:03:04 AM8/17/08
to
"Ross Ferris" <ro...@stamina.com.au> wrote in message
news:9e9d0c8f-afbf-4073...@l33g2000pri.googlegroups.com...

Ricky,

Ross - I asked the System Admin if he knew of any Mac programs that we could
run in place of Blat and he didn't have a clue. I'll pass this along to him.
But the real question is - How do you execute a Mac program from D3Linux?


Andrew Kenna

unread,
Aug 17, 2008, 5:00:40 PM8/17/08
to
Hi Ross,

From a linux point of view it is very easy to send out an email message,
there are a couple of options depending on what type of msgs want to be sent
out

1) Write out a txt file into a /tmp directory in the Linux Filesystem and
then execute the linux mail command
2) Same as step 1 but you can pipe it through sendmail which would allow you
to control what email address the msg is going to from within Pick

There are other commercial alternatives out there, but the above two would
cater for most situations. There are obviously the exceptions like if you
want to uuencode or send massive attachments then you need to look at a more
robust commercial solution.

Andrew

"Ross Ferris" <ro...@stamina.com.au> wrote in message
news:9e9d0c8f-afbf-4073...@l33g2000pri.googlegroups.com...

Peter McMurray

unread,
Aug 17, 2008, 6:54:57 PM8/17/08
to
Hi
10 years ago I interfaced Postie to Universe - it was exceptionally easy as
it has a straightforward command line interface that one can EXECUTE for
both Windows and Unix. A quick google shows that www.infradig.com is still
very active and $50 is well worth it.
Peter McMurray

"Ricky Ginsburg" <ric...@fawnridge.com> wrote in message
news:g7hl2q$74v$1...@aioe.org...

Tony Gravagno

unread,
Aug 18, 2008, 3:09:36 PM8/18/08
to
"Ricky Ginsburg" wrote:
>But the real question is - How do you execute a Mac program from D3Linux?

Small, identical client/server components on both sides, written in
Mono (my preference) or Java. Example:

EXECUTE "!msg2remote machost execute thiscmd param1 param2..."


I have a supply of solutions - just waiting for a supply of demand. ;)

Ricky Ginsburg

unread,
Aug 18, 2008, 6:16:17 PM8/18/08
to
The only demands I have are sunny days and a clean beach towel.

--
Ricky Ginsburg

Have you seen Ricky's new website?
http://www.fawnridge.com/ricky

"Tony Gravagno" <address.i...@removethis.com.invalid> wrote in
message news:dihja496caelv05qh...@4ax.com...

Scott Ballinger

unread,
Aug 18, 2008, 6:48:48 PM8/18/08
to
On Aug 17, 3:54 pm, "Peter McMurray" <excalibu...@bigpond.com> wrote:
> Hi
> 10 years ago I interfaced Postie to Universe - it was exceptionally easy as
> it has a straightforward command line interface that one can EXECUTE for
> both Windows and Unix.  A quick google shows thatwww.infradig.comis still

> very active and $50 is well worth it.
> Peter McMurray

This has to be one the most asked questions on cdp. I googled "send
email from pick" in cdp and got 299 results.

Peter is right- Postie is the easiest and simplest way to do this. It
works with smtp servers, pop & imap accounts, handles attachments, and
can send and receive. You can download versions for windows/unix/
linux to try for free, but I hope you'll end up sending Andrew the $50
he deserves. Postie is flexible, cheap, bulletproof, and installed at
every site I administer.

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

GlenB

unread,
Aug 18, 2008, 11:08:08 PM8/18/08
to
"Ricky Ginsburg" <ric...@fawnridge.com> wrote in message
news:g8csbk$pkd$1...@aioe.org...

> The only demands I have are sunny days and a clean beach towel.
>

And a hurricane-less tropical season each year...

GlenB


Gene

unread,
Aug 19, 2008, 9:50:03 AM8/19/08
to

Here's how I do it:

#!/usr/bin/perl -w

use strict;
use MIME::Lite;
use Getopt::Std;

#------------------------------
# main
#------------------------------
sub main {
my %opts;

### Get options:
getopts('', \%opts) or die "usage error\n";
my $addr = $ARGV[0] || die "Missing email address.\n";
my $fpath = $ARGV[1] || die "Missing filename to attach.\n";
my $subj = $ARGV[2] || die "Missing Subject.\n";

my $msg = MIME::Lite->new(From => 'mai...@plygempw.com',
To => $addr,
Subject => $subj,
Type => "multipart/mixed");
$msg->attach(Type => "text/csv",
Path => $fpath,
Disposition => "attachment");

MIME::Lite->send("smtp","<your.mail.server>", Timeout=>60);
$msg->send;
}
exit(&main ? 0 : -1);
1;
__END__


This requires MIME::Lite and you can get that via CPAN. To send
other attachment types, just change the "text/csv" to whatever you need.
For example, PDF files would use "application/pdf".

I call this script via rule module in D3. A simple EXECUTE and it's done.

g.

Tony Gravagno

unread,
Aug 19, 2008, 8:48:50 PM8/19/08
to
The code that Gene generously provided is very simple to the original
NebulaMail. This is part advertisement and part solid info, so please
bear with me. When I create a solution it's not a "tier-1" solution,
I try to carry it though to solve the issues at next step.

The next step with the Perl code that Gene provided is:
My customers want this on their Windows system.
Great, go to ActiveState, get Perl for Windows, and install it on
every client system. Then configure CPAN to auto-download the various
required modules.

The next step is:
Sometimes we want CSV and other times PDF or XLS or...
Great, dynamically generate the Perl code from BASIC.

The next step is:
Our clients' SMTP servers require user/login.
Great, add parameter handling to the Perl code to accept a userID and
password.

The next step is:
Everything stopped. What happened?
Great, add error handline with "die" statements that return an error
message back to BASIC to let the application know what happened.
Usually the problem is that someone changed SMTP settings.

The next step is:
Can we BCC ourselves to make sure it's working?
Sure, add more arguments to the MIME:Lite constructor.

As you can see this can go on for a very long time. NebulaMail was
created to keep the MV developer in BASIC and out of Perl, allow all
the features without having to recode to support every new request,
and most of all to be completely platform independent.

Again, this is honestly not intended to be a sales presentation but a
notice to anyone doing this sort of work that the very first step (as
shown in Gene's excellent code) makes a production solution look
deceptively simple in the beginning. That's why I've taken the time to
create solutions that actually do keep it simple for the first
customer through the last, and the first installation through the
last.

HTH
T

Gene

unread,
Aug 20, 2008, 10:03:45 AM8/20/08
to
Tony Gravagno <address.i...@removethis.com.invalid> wrote:
> The code that Gene generously provided is very simple to the original
> NebulaMail. This is part advertisement and part solid info, so please
> bear with me. When I create a solution it's not a "tier-1" solution,
> I try to carry it though to solve the issues at next step.
>

Here's another bit for the *nix geeks in the audience:

#!/bin/bash

case "$4" in
txt)
/usr/local/bin/mail_csv $1 $2 $3
;;
pdf)
/usr/local/bin/enscript -e -Z -B --non-printable-format=space -h -H --highlight-bar-gray=.80 --landscape -j --font=Courier-Bold8.5 --ps-level=1 $2 > $2.ps 2>/tmp/enscript.errors
/usr/bin/ps2pdf $2.ps $2.pdf 2>/tmp/ps2pdf.errors
/usr/local/bin/mail_pdf $1 $2.pdf $3
;;
esac

The enscript command line is pretty long, so it may or may not get cut off
by your newsreader software.

If you want to create a simple way to spool output directly to a hard
coded email address, you can set up a special printer entry:

STARTSHP <ptr#>,<ptr#>,0,S<port>,LP.UNIX,(/usr/local/bin/print_pdf)

print_pdf looks like this:

/usr/local/bin/enscript -e -Z -B --non-printable-format=questionmark -h -H --font=Courier-Bold7.5 --ps-level=1 --media=PDFLetter > /tmp/print_pdf.ps
/usr/bin/ps2pdf /tmp/print_pdf.ps /tmp/print_pdf.pdf
/usr/local/bin/mail_pdf <your_email_address> /tmp/print_pdf.pdf Printed_PDF_Report

This basically emails you a PDF file that has the D3 printer job in it.
Note that unless you've got the form set up to handle the number of lines that
the PDF file has per page (84 lines or so if memory serves), your pagination
is going to be all screwed up. However, for a quick & dirty output check
it beats the hell out of wasting paper when you're developing a complex report.

g.

0 new messages