Operating System - HP-UX
1824822 Members
3934 Online
109674 Solutions
New Discussion юеВ

Setting Up Email Printers

 
SOLVED
Go to solution
Jorge Chinchilla
New Member

Setting Up Email Printers

Is it possible to setup printers to do email as output. Has anyone done this before?
5 REPLIES 5
harry d brown jr
Honored Contributor

Re: Setting Up Email Printers

jorge,

I think you should be able to create your own model file. Copy an existing one to a different name and go for it.

live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor
Solution

Re: Setting Up Email Printers

I JUST HAD TO TRY IT!

THis is the model file I created (myemail model file):



I set up the LOCAL printer with a special device of /dev/null
#!/usr/bin/sh
# lp interface for emailing
#
#=======================================================================#
# OPTIONS RECOGNIZED: ( none ) #
#=======================================================================#
#########################################################################
PATH="/usr/bin:/usr/lib"
export PATH

# Print the standard header

name=$2
user=`pwget -n $2 | line | cut -d: -f5`

# The remaining arguments are files

shift; shift; shift; shift; shift
files="$*"

# Print the spooled files

for file in $files
do
uuencode $file $file.txt | mailx -m -s "print mail from $name - $user" hbrown@paychex.com
done

exit 0



And the damn thing worked!



live free or die
harry
Live Free or Die
Jorge Chinchilla
New Member

Re: Setting Up Email Printers

Harry I tried your script but I have not gotten an email with the data. Am I missing something?
harry d brown jr
Honored Contributor

Re: Setting Up Email Printers

Jorge,

You first have to make sure you can email from your server to yourself. Of course replace the hbrown (AT) paychex.com with your email address.

So from the unix prompt on that server try this to see if mail can move from your server to your mail server:


uuencode /etc/hosts hosts.txt | mailx -m -s "host file" JORGESemail@where_ever.com

live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: Setting Up Email Printers

Jorge,

Any luck??

live free or die
harry
Live Free or Die