Sending formatted email from unix.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sending formatted email from unix.
# 1  
Old 09-15-2012
Question Sending formatted email from unix.

Hi All,

I need to send email from unix in the below format. But the email body is coming all in one single line.
How do i format the below text, so that the body of email is properly formatted.
Please help.

Code:
TO:  <email id>
CC:  <none>
BCC: <none>
Subject: Support: file GENERATION is SUCCESSFUL for <FILE TYPE> (Environment: <PROD>)
Body:
Dear Support Team,

This email is to inform you that the Gatekeeper file that is mentioned in subject line is generated successfully today.


Please do not use the reply button, as this is a system mailbox that is not monitored.

Thank You.


Last edited by fpmurphy; 09-15-2012 at 11:54 AM..
# 2  
Old 09-15-2012
how are you trying to send the email?
# 3  
Old 09-15-2012
You could use the fmt command, but I don't think this is neccessary as the receiver's mail client will wrap the lines according to his/her needs
# 4  
Old 09-17-2012
Question i am using below foramat in email:

Hi,
I am using below. Is right right way to send the formatted email. Please help me out.

Code:
subject="$task of $filename is $status 

mailx -s "$subject" email_id <<end_of_mail
   Dear Support Team,

This email is to inform you that the files are NOT generated successfully today from the environment that is mentioned in subject line due to the below error. Please take necessary actions.

ERROR: Files are available in directory $dir. 

Please do not use the reply button, as this is a system mailbox that is not monitored.

Thank You.
end_of_mail


Last edited by vbe; 09-17-2012 at 10:49 AM.. Reason: code tags uses square brackets... nice try thought...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending email in UNIX

can you tell me what is the syntax if I need to keep someone in cc with the below email. mailx -s "shell script completed successfully" arun@gmail.com < /dev/null (4 Replies)
Discussion started by: ramkumar15
4 Replies

2. Shell Programming and Scripting

Sending formatted email with sendmail question

Hi All, Can anyone help with an email formatting question: Im using the following example to try and send a formatted email: outputFile="file.txt" ( echo "From: oracle@inovis.com" echo "To: john.dickinson@gxs.com" echo "MIME-Version: 1.0" echo "Subject: Test Font" echo... (4 Replies)
Discussion started by: jonnyd
4 Replies

3. UNIX for Advanced & Expert Users

Sending email from UNIX server

Hi, I am trying to send an output of a script in an email. I want to know if there is a way to modify the senders email not as my username on the host server but as one of the sender preset on outlook. I was using cat email.log | /bin/mailx -c cclist -r myemailid -s "subject" tolistids ... (4 Replies)
Discussion started by: gopajitmalakar
4 Replies

4. Shell Programming and Scripting

Sending email from a unix program

Hi, I have create a unix prog file to validate data and send out an email. Below is the command used to send out email in the program. But it is not triggering the email. Please advice on this. (echo ${MESSAGE};uuencode "$FCP_OUT" "ERROR_REPORT.csv"; uuencode "$VALIDATION_RPT"... (1 Reply)
Discussion started by: contactsmrajesh
1 Replies

5. Shell Programming and Scripting

Font change in unix while sending email

Hi, I know that we would be require HTML to change the font and color of the text of the output, if we wnt to send that through the email. But I have managed to get below code, can someone look into it and let me know if i can acheive my requirement through this kind of code: Following can... (9 Replies)
Discussion started by: amit.mathur08
9 Replies

6. Shell Programming and Scripting

Sending email from Unix

I am using the following syntax to send an e-mail from Unix (Sun OS). mail -s "hello" abc@yahoo.com But, when I click enter after typing this command, its not exiting and after a while when I give ctrl+c it creates a dead.letter file in my $HOME dir. Can anyone please tell me, if I have to... (7 Replies)
Discussion started by: rajesh8s
7 Replies

7. HP-UX

Sending Unix files as attachments in an email

Hi, I am executing the following command in order to send a file as an attachment: mailx -s "Subject" emailID@xyz.com < Testfile.txt Instead of attaching the file Testfile.txt, it is writing the contents of the file in the email message body. Please advise on how I can send the file as an... (7 Replies)
Discussion started by: sangharsh
7 Replies

8. Shell Programming and Scripting

sending email from KSH unix script.

Hi Need guidance on including code to mail a couple of files atached with some subject and mail body !!.. Thanks in advance (3 Replies)
Discussion started by: rosh0623
3 Replies

9. Shell Programming and Scripting

sending email in unix. need help!

how can I send an email in UNIX, attach a file and cc a receipient? i use the command below to attach a file (this works): uuencode path/filename filename | mailx -s "subject" addr@host.com here is how i cc a receipient (this also works): i have a file named cc.lis and contains: Hello... (2 Replies)
Discussion started by: tads98
2 Replies

10. Shell Programming and Scripting

unix - c program sending error from DB to email

hi, i have a database table that automatically logs the errors in the database every 5 mins. what i want to happen is to come up with a program using unix-c that gets all the information from the log table, i have a flag initially set to zero which means that the error is not yet sent, the... (2 Replies)
Discussion started by: chino_52284
2 Replies
Login or Register to Ask a Question