Sponsored Content
Top Forums Shell Programming and Scripting Script needed which will send a mail with attachment files Post 302147049 by aabhas.bhargava on Saturday 24th of November 2007 02:22:55 AM
Old 11-24-2007
here u go the script to send mail with attachment

EMAIL="Email@address.com"
MSG="Message:BODY of the Text"
echo "$MSG"
echo "Mail Sent to $EMAIL"
uuencode Path/to/file.csv file.csv>msg.csv
echo "$MSG">msg

cat msg msg.csv >email.msg

mailx -s "Test Email" $EMAIL <email.msg
rm msg
rm email.msg
 

10 More Discussions You Might Find Interesting

1. AIX

Command line/Script to send E-mail with HTML body and binary attachment

I apoligize for the cross-post but I'm not getting much in the way of help in the dummies forum: I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements: 1. command line switch to specify file name containing message body in HTML format 2. command... (3 Replies)
Discussion started by: G-Man
3 Replies

2. Shell Programming and Scripting

How to send a mail with attachment?

Hi, I usually write a file TEST.MAIL like this to send mails: Importance: High Priority: Urgent X-Priority: 1 (Highest) From: user Subject: error ... text body .... and then I launch it (or writre a c-chell that launchs it) by writing: mail a@b.com < /users/.../TEST.MAIL How can... (4 Replies)
Discussion started by: albaalbetti
4 Replies

3. AIX

Send mail with attachment having csv files

Hi, Could anyone please help me to send multiple files of .csv format in one mail. Thanks Aj (2 Replies)
Discussion started by: atinjain05
2 Replies

4. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

5. Shell Programming and Scripting

how to run a script using cron job and send the output as attachment via e-mail using unix

how to run a script using cron job and send the output as attachment via e-mail using unix. please help me. how my cron job entry should be? As of now my cron job entry is to run the script at specific time, 15 03 * * * /path/sample.sh | mail -s "Logs" email_id In the above entry, what... (8 Replies)
Discussion started by: vidhyaS
8 Replies

6. Shell Programming and Scripting

How to send mail with attachment in Unix

Hi All, Is it possible to send mail in Unix with attachment. If yes, then how?? (8 Replies)
Discussion started by: parthmittal2007
8 Replies

7. AIX

Need to send attachment in Mail without using uuencode via script in AIX6.1

Dear All, Would some one help me with this to send a file as attachment in a mail using a script without uuencode... I am working on AIX 6.1, the thing is I dont have uuencode available... Is there any other alternate possible way to send file attachment with the mail without using uuencode... (11 Replies)
Discussion started by: msmadhan11
11 Replies

8. Shell Programming and Scripting

Send mail using attachment

Hi All, I need to send mail with attachment. I am using uuencode but it seems it is sending encoded file. I am getting the mail with attachment but there is no data even the file size is almost 90KB. Please help. Thanks. (3 Replies)
Discussion started by: unankix
3 Replies

9. Shell Programming and Scripting

Send mail as attachment

Hi All, I am trying to send mail via unix and attaching file along with that mail, but facing issue while sending. I have tried below commands- 1)- uuencode $prmDirOutput/report_mailbody $prmDirOutput/report_mailbody | mailx -s "Acknowledgment file- $subject" $email_id 2)- mutt -a... (4 Replies)
Discussion started by: Amit786
4 Replies

10. Shell Programming and Scripting

Send Mail With Attachment

Hi, I need to send attachment with email as external attachment. Presently, we are using uuencode to make an attachment but it is going as content of body. We are using below command. uuencode "filename1" "filename2" | mailx -r "$SENDFROM" ${SENDTO} In unix box, -a is not supportable... (1 Reply)
Discussion started by: vamshi929
1 Replies
Cone(C)

CONE(1) 						  Cone: COnsole Newsreader And E						   CONE(1)

NAME
cone - Read and send E-mail messages SYNOPSIS
cone [-r] [-c directory] USAGE
Cone is a console newsreader and E-mail. It is an interactive program for reading and sending E-mail messages. Cone is designed to be intuitive and easy to learn. Starting Cone for the first time displays two links: one for the default system mailbox, and a second link to a quick online tutorial. The online tutorial provides a brief overview of using Cone for reading and sending E-mail. Pressing Q on most screens exits Cone. Cone tries to gracefully log out and shut down all server connections. If Cone cannot log out of a remote server because the remote server is down, press CTRL-C (after Q to terminate Cone). Use CTRL-Z to temporarily suspend Cone and drop back to the shell prompt. Cone remains suspended in the background, and may be restarted by using the shell's fg command. Note Connections to remote mail servers may be disconnected for inactivity if Cone remains suspended for a prolonged period of time. When suspended, Cone cannot maintain any active connections to remote mail servers. The -c option names a directory where Cone saves its configuration files, and defaults to $HOME/.cone. The configuration directory will be created, if necessary. The -r option recovers a backup copy of Cone's configuration file. This option is primarily used when remote configuration is enabled, but the folder that contains Cone's configuration on a remote server was deleted, or is not available. In all cases, Cone makes a daily local configuration file backup. The -r option searches for local configuration file backups, and offers an option to restore the backup copy. Reading local mail with Cone Cone reads local mail from either maildirs (the preferred format) or mailbox files (or "mboxes"). When mboxes are used, Cone does not read the system mailbox file directly (usually /var/spool/something). All messages in the system mailbox are automatically moved to $HOME/Inbox, which is then accessed as if it was the system mailbox. Starting Cone for the first time on an mbox-based system automatically copies all existing mail from the system mailbox file to $HOME/Inbox. This is an intentional design choice. Normal user application cannot create new files in /var/spool; all they can do is read the mailbox file from /var/spool. Therefore, the only way to update the mailbox file is by rewriting it from scratch (more or less). While the mailbox file is in the process of being rewritten, if the Cone process is interrupted, or killed, the resulted in a corrupted system mailbox. There are way to minimize this vulnerability, but it cannot be eliminated completely. Some Linux kernels use an "OOM killer" that may terminate any process when the system memory is low. There is no way to completely prevent corrupted system mailbox files on those kernels. Cone uses an alternative way of updating mboxes. Cone updates mboxes by creating a new mbox file separately, then replacing the original mbox file with the new version. Unfortunately this cannot be done with the system mailbox file, because of the restricted access rights on the system spool directory. To solve this problem Cone automatically copies the system mailbox file to $HOME/Inbox, each time the system mailbox file is opened and whenever new mail is available. Viewing MIME attachments Cone displays text and simple HTML content by itself. Other kinds of attachments may be viewed by using a helper script. Cone invokes a helper script to open a MIME attachment. The helper script's name is "TYPE.SUBTYPE.filter", where "TYPE" and "SUBTYPE" corresponds to the MIME type and subtype, accordingly. Cone looks for helper scripts in $HOME/.cone (or the directory specified by -c) and in /usr/share/cone. For example, a helper script named "IMAGE.GIF.filter", if installed, is invoked to process image/gif MIME attachments. Helper scripts Cone runs each helper script twice: TYPE.SUBTYPE.filter check type/subtype When the first argument is "check", the helper script should terminate with a zero exit code if it is willing to process an attachment whose MIME type is specified by the second argument. A script or a program that's has multiple "TYPE.SUBTYPE.filter" links may use the second argument to identify the attachment's mime type. If the helper script is unable to process the attachment, at this time, it should terminate with a non-zero exit code. The default helper script for image attachments terminates with a non-zero exit code if the DISPLAY environment variable is not initialized. When invoked from an X-Windows terminal, image attachments will be automatically displayed; and image attachments are ignored otherwise on non-graphical consoles. TYPE.SUBTYPE.filter filter type/subtype filename If the helper script initially terminates with a zero exit code, it will be invoked again after the MIME attachment is downloaded and decoded. The first argument will be "filter", and the attachment's filename is specified by the third argument. Note This is a temporary file, whose extension will not necessary be the file extension associated with this MIME type. The helper script should read and process the file specified by the third argument. Cone interprets anything the helper script writes to standard output as HTML. Note Cone waits until the helper script terminates before displaying the rest of the message. Most helper scripts should run in the background. However, note that Cone removes the temporary file when the original message is closed; the temporary file may be removed any time after the helper script terminates. The helper script should make its own private copy of the file, if necessary. Activating URLs Cone has limited ability to activate URLs in HTML messages. Cone handles "mailto:" URLs by itself. For other URLs Cone runs /usr/share/cone/method.handler with the URL passed as an argument. Cone installs http.handler (hard linked to https.handler). This script checks if firefox or mozilla binaries are found in the current PATH, and runs them. Note Cone also looks method.handler in $HOME/.cone (or the directory specified by -c) in addition to /usr/share/cone. FILES
$HOME/.cone Configuration files, and other application data. May be modified by the -c option. /usr/share/cone/IMAGE.GIF.filter, /usr/share/cone/IMAGE.JPEG.filter, /usr/share/cone/IMAGE.PNG.filter, /usr/share/cone/APPLICATION.PDF.filter Default helper scripts distributed with Cone. SEE ALSO
mailtool(1), sendmail(8). AUTHOR
Sam Varshavchik Cone(C) 04/04/2011 CONE(1)
All times are GMT -4. The time now is 08:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy