How to receive message in 2 lines using mailx command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to receive message in 2 lines using mailx command
# 1  
Old 07-17-2009
How to receive message in 2 lines using mailx command

Hi,

I have a file with 2 records in two lines. While mailing these two records using mailx command, those two records coming in a single line. I have used the following command to send those records via mail.

Code:
cat filename | mailx -s "subject" mailaddress

I want the two records in seperate lines in the mail.

Please help me in this.

Thanks in advance.

Next time use CODE-tags when displaying code, data or logs to enhance readability and to keep formatting like indention etc., ty.

Last edited by zaxxon; 07-17-2009 at 05:00 AM.. Reason: code tags
# 2  
Old 07-17-2009
There should be nothing changed to the newline character. I just tried it out and both lines are separate. Maybe test it with another mail client - could be that it is displayed different. I am using Thunderbird.
# 3  
Old 07-17-2009
Quote:
Originally Posted by zaxxon
There should be nothing changed to the newline character. I just tried it out and both lines are separate. Maybe test it with another mail client - could be that it is displayed different. I am using Thunderbird.

It appeared as single line only. i tried with another mail client also.i am using target
# 4  
Old 07-31-2009
Using HERE document might work.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Solaris

Mailx message not delivering externally

I have recently all of a sudden stopped receiving my cronjob messages that were being sent with the mailx command. I have not made any changes and it is affecting all my servers at this site only (all running Solaris 10). At my other site I am running a mixture of Solaris 10 and Ubuntu 14, and they... (2 Replies)
Discussion started by: Madrox72
2 Replies

2. Shell Programming and Scripting

Mailx with attachment and message body

i have to attach the 'body in the email' along with attachment below code is throwing errors, how can i do it ? here body file contains message, it should display in email, please help i am using HP-UX (cat body ;) (uuencode attch1 attch1 ;) | mailx -m -s "testing" "abc@gmail.com" ... (4 Replies)
Discussion started by: only4satish
4 Replies

3. UNIX for Dummies Questions & Answers

Mailx empty body message

Hi, Is there a way to suppress this message? Null message body; hope that's ok My email string is: mailx -s "This is my subject" myemail@domain.com < /dev/null It's just an annoyance to me that I would like see go away. (3 Replies)
Discussion started by: bbbngowc
3 Replies

4. Shell Programming and Scripting

I could not receive the mail sent from the unix server using 'mailx'

Hi All, I have sent a mail to my gmail id using the below command. echo " " | mailx -s "sub" myid@gmail.com I didn't get any error notification. But still I didn't receive that mail still.. please help me to learn how to send mail to other provider (Yahoo/gmail) from unix server.... (1 Reply)
Discussion started by: little_wonder
1 Replies

5. Shell Programming and Scripting

Problem while sending message and attachment with mailx

Hi All, I am trying to send a mail with an attachment and message. Following command I am using. (cat <messagefile> ; uuencode <attachmentfile> <attachmentfile>)|mailx -s"Subject" dave@email.com In the received mail, message body is appearing fine. But attachment is not coming. Rather... (2 Replies)
Discussion started by: nihar.dutta
2 Replies

6. UNIX for Dummies Questions & Answers

mailx error message : mailx: NUL changed to @

If I use the "Mail" link instead of the "mail" link to ../mailx I get this error. Mail so-n-so @whatever.com mailx: NUL changed to @ Unknown command: "postmaster" The email still goes through but i get the error. If I use "mail" it goes thru without the error. Any ideas?? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

7. UNIX for Advanced & Expert Users

email attachment, with a message using mailx

Hi, I am trying to include a message along with an attachment with an email using mailx on AIX. uuencode Test.dat Test.dat| mailx -s 'Testing' mymail@yahoo.com < MESGFILE This only gives me the contents of MESGFILE as my message. If I remove the < FILE I recieve the attachment. What... (4 Replies)
Discussion started by: edog
4 Replies
Login or Register to Ask a Question