Mutt command - email body with out file name


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Mutt command - email body with out file name
# 1  
Old 06-06-2013
Mutt command - email body with out file name

Hello All,
I know we can put body inside a mail using -i option for specifying the file which contains body message, is there an option for me to specify body content instead of a file specification only using mutt?

Below is not working and i don't see any options in manual page!

Code:
/usr/bin/mutt -s "Hey Testing" "(something as body??)" -c "xyx@fxxxg.com,xxxxx@yahoo.com" </dev/null

Thank you.

---------- Post updated at 05:24 PM ---------- Previous update was at 03:08 PM ----------

I changed mind to use mailx instead of mutt, however i am facing an issue when i receive the email i see everything in one line. i did "echo -e \n" while producing the file but it is putting one more a line or a space between 2 lines. May i know how i can see the output in email as of raw file.

Code:
for i in `cat "${GEN_PARAM_LIST3}"`
do
        UNINUM=`echo $i | awk -F"|" '{print $1}'`
        PROVIDER=`echo $i | awk -F"|" '{print $2}'`
        EXTRACT_DT=`echo $i | awk -F"|" '{print $3}'`
        PROCESS_STATUS=`echo $i | awk -F"|" '{print $4}'`

        echo "Provider:"$PROVIDER", Uninum:"$UNINUM", Extract Date:"$EXTRACT_DT", Loading Status:"$PROCESS_STATUS"" \
        >> "${LOG_DIR}"/StageLoadEmailBody

done
(cat ${LOG_DIR}/StageLoadEmailBody) | /bin/mailx -s "Provider File Loaded Successfully" "${EMAIL_LIST}"

content of actual $EMAIL_LIST file
Code:
Informatica Was Able To Successfully Load the Provider File
Provider:16, Uninum:710119, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:610000, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710056, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710122, Extract Date:2012-09-30, Loading Status:COMPLETED

Email output in Outlook:

Code:
Informatica Was Able To Successfully Load the Provider File Provider:16, Uninum:710119, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:610000, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710056, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710122, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710139, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710739, Extract Date:2012-09-30, Loading Status:COMPLETED

# 2  
Old 06-06-2013
Using awk inside a shell for loop is an overkill. So you can simplify it a bit:
Code:
awk -F\| '
        BEGIN {
                print "Informatica Was Able To Successfully Load the Provider File"
        }
        {
                print "Provider: " $1, " Uninum: " $2, " Extract Date: " $3, " Loading Status: " $4
        }
' OFS=, "${GEN_PARAM_LIST3}" | /bin/mailx -s "Provider File Loaded Successfully" "${EMAIL_LIST}"

This User Gave Thanks to Yoda For This Post:
# 3  
Old 06-06-2013
I am generating the output file using the for loop and i am putting(cat & email) that content of that output file as body of the email and sending an email. I tested with other files and i see no problems they are well formatted, somehow my output file is wrong or something which i am not sure, though physically looking at looks good.
Code:
(cat test.sh) |  mailx -s "Hey" "smadala@farmcreditfunding.com"

# 4  
Old 06-06-2013
If you think this is something to do with output file. Check them with od or cat:
Code:
od -c file

Code:
cat -Evt file

This User Gave Thanks to Yoda For This Post:
# 5  
Old 06-07-2013
looks like comma's were causing the issue and outlook interpreting them as contiunation of paragraph and wrapping the lines. When i replace comma with pipe everything was working fine no conversion nothing, simple echo commands to generate output file. I see the expected output in outlook email with no spaces between lines and multiple lines.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mutt command email body

Hi Team, While sending the email using the mutt command, mail body not appearing properly and attachment it is showing without line breaks and i used the CSS Style (nowrapper )it is working fine. in this case how to handle the email body, please help me. (1 Reply)
Discussion started by: bmk123
1 Replies

2. Linux

Sending an email using mutt...

I wanted to send "config.log" to the usergroup that handles open source support for Octave 3.8.0, a programming language as there were build errors. In order to send an email from unix command line, I am trying to use mutt, and I need a straightforward way of sending emails, as the commands... (1 Reply)
Discussion started by: jon80
1 Replies

3. Shell Programming and Scripting

Sending attachment with email without using uuencode and mutt

Hi All, do we have any option for sending attachment with email except using uuencode and mutt, because if i use these utilities then i will have to install them separately which is not feasible at time. please suggest on this. (2 Replies)
Discussion started by: lovelysethii
2 Replies

4. UNIX for Advanced & Expert Users

Mutt for html body and multiple html & pdf attachments

Hi all: Been racking my brain on this for the last couple of days and what has been most frustrating is that this is the last piece I need to complete a project. There are numerous posts discussing mutt in this forum and others but I have been unable to find similar issues. Running with... (1 Reply)
Discussion started by: raggmopp
1 Replies

5. Shell Programming and Scripting

issue with Email Body

Hi, I have written shell program to send email as below - #!/bin/ksh filename=`ls -ltrh *.Z` echo $filename |mailx -s "FOR TESTING" rahul.b@infotech.net I am getting the email but email body is - -rw-rw-r-- 1 bahulra dba 173M Mar 22 04:37 corphist.txt.Z -rw-rw-r-- 1 bahulra dba 107M... (3 Replies)
Discussion started by: rahulbahulekar
3 Replies

6. Shell Programming and Scripting

How to split a csv file and zip it and attach using mutt command?

We need to redirect the output of a query to .csv file each containing a specified number of lines.Then we should zip these files and send as attachment using mutt command. We tried using split -l 500 query_output.txt outputfile Since we are not sure about the exact number of files... (0 Replies)
Discussion started by: Jassz
0 Replies

7. Red Hat

Send HTML body and HTML attachment using MUTT command

Hi there.. I need a proper "mutt" command to send a mail with html body and html attachment at a time. Also if possible let me know the other commands to do this task. Please help me.. (2 Replies)
Discussion started by: vickramshetty
2 Replies

8. Shell Programming and Scripting

emailing as body of email

hi all, how do i email a file in the body of an email rather than as an attachment ?? have a ksh script which i need to read a file and email as part of the body rather than an attachment. my code is : uuencode file.log | mailx -s "test" but this sends file as an attachment. ... (2 Replies)
Discussion started by: cesarNZ
2 Replies

9. Shell Programming and Scripting

how to check body of the email

Dears, i have user called dellsh i hope to make this script when this user recieve email check the budy of the email about (StatusRequest) when i find this email contain this subject run crontab do this job (create file in my home directory called index) thanks for your attention (1 Reply)
Discussion started by: dellsh
1 Replies

10. UNIX for Dummies Questions & Answers

To send an email with the body content extracted from a file

Hi, I have been trying to shoot an email with the email body to be obtained from a file. Can someone please help me with it.. I have been trying to use the MAILX commad for the same. mailx -s "test email" -r sender@test.com < file.txt but it sends the file as an attachment,while i... (3 Replies)
Discussion started by: rohit.shetty84
3 Replies
Login or Register to Ask a Question