Print to Email


 
Thread Tools Search this Thread
Operating Systems SCO Print to Email
# 1  
Old 05-12-2009
Print to Email

Hello I hope someone can help me.

As part of an acquisition I have inherited a ERP system running on a SCO 5 server, unfortunately I don't have much Unix knowledge. I have been asked to configure a script so that when users print a report from the ERP software it runs a script that sends the report to the users mailbox as an email attachment. I have no idea how to do this.

I know mail is set up on the server and I know how to configure the ERP so it prints to a script but I don't know what should go in that script.

Our mail system is MS Exchange if that makes a difference.

Could any give me a idiots guide on how to do this?

Cheers
Craig
# 2  
Old 05-12-2009
Hammer & Screwdriver Here is a piece of one of my scripts

Some of the variables are defined earlier in the script. However, this might provide some basics of emailing a file attachment to people.

Code:
echo "#### Emailing the reports"
# create summary for email
echo "Summary Report of items un-processed ${DataSet} data ">$msgtxt
echo "Script name = ${SCRIPT} " >>$msgtxt

# over-ride default set by unix
m_frv='set from=abc@xyz.com; set realname="Client Automation"'
m_subj="Items Analysis"
# recipient
m_recipients="jg@xyz.com"
# people to get cc copies
m_recipients_cc="group@xyz.com"
 
# determine the size of the file attachment; if greater than 65k lines do not send
#  Excel does not like these long files; email may not like to send large files
csv_cnt=$(wc -l ${workx4} | awk '{print $1}')
if [ $csv_cnt -lt 65000 ]
   then
     /usr/local/bin/mutt -nx -e "$m_frv" -s "$m_subj" -a "$workx4" -c "$m_recipients_cc" "$m_recipients" <$msgtxt
   else 
     /usr/local/bin/mutt -nx -e "$m_frv" -s "$m_subj" -c "$m_recipients_cc" "$m_recipients" <$msgtxt
fi

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting email output in single line with out space in email

I have tried below email method and i am getting every thing in single line . i have put echo to provide space, but it is not helping my code ( echo "From: $FROM" echo "To: $MAILTO" echo "CC: $CC" echo "Subject: $SUBJECT" echo "MIME-Version: 1.0" echo 'Content-Type: multipart/mixed;... (6 Replies)
Discussion started by: mirwasim
6 Replies

2. Shell Programming and Scripting

awk print the body of an email

I have fetched a couple of emails and stored then in /fetch/mail/oracle.txt, the displayed content is Date: From: Subject: To: Content-Type: ---body ----- --------- Date: From: Subject: To: Content-Type: ----body ----- ------ Date: From: I want to retrieve the body only from... (3 Replies)
Discussion started by: maddog21
3 Replies

3. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

4. UNIX for Dummies Questions & Answers

Script to print email from defined sender.

Hello all! I'm looking to setup some sort of script so that when a an email comes in from a specific address the message and/or attachments are automatically printed. Any ideas on where to start? Thanks for the help. (9 Replies)
Discussion started by: Mr. Biggz
9 Replies

5. UNIX for Dummies Questions & Answers

new to ldap, send email to a ou or group, and see a list from email client

hi, i'm running openldap on ubuntu 10.04, creating new items with apache directory studio (windows version). i use the ldap just as an address book to our small office (email clients are windows live mail 2009, 2011, microsoft outlook 2007 and 2010). a. i cant see a list of the contacts,... (0 Replies)
Discussion started by: V4705
0 Replies

6. Shell Programming and Scripting

Echo print in different lines within email sent by Cron job

Hi all, I think this could have a simple solution, just I canīt get it so far. I have the script below that includes several echo commands in order to show that every part of the script have been executed. A cron job executes this script and when is completed the output is sent by email. ... (4 Replies)
Discussion started by: cgkmal
4 Replies

7. Solaris

Send an email from Solaris using Linux email server

Hello everyone I have a problem and I need your help: I have a Solaris 10 and Solaris 8 UNIX Servers, and Linux Centos4 as email server. I need send an email from Solaris servers preferably using Centos4 email server. I have no mail service configured in my Solaris computers (1 Reply)
Discussion started by: aflores
1 Replies

8. Shell Programming and Scripting

Print log to an email

Hi, I have wrote a script and i want to be able to output my variable MSG_DEST (which is a log) to an email. so basically log contains: hello John when i email recipient it says to xxxxxx from xxxxxx subject xxxxxx hello John What do I need to put in my... (3 Replies)
Discussion started by: Pablo_beezo
3 Replies

9. UNIX for Dummies Questions & Answers

Send email where # is in the email address - Using Unix

Hi All, How do I send an email using malix where email address contains a #. I have a email address like this : #test@test.com I want to send email like malix -s "TEST" #test@test.com < SOMEFILE I tried \# but doesn't work. Please let me know how we can achieve this? I am in... (1 Reply)
Discussion started by: jingi1234
1 Replies

10. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies
Login or Register to Ask a Question