Email issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Email issue
# 1  
Old 09-07-2015
Email issue

hi all,

i am not getting with the email attached not sure what wrong with the syntax can u help me out plz.

cat notavailabltext.txt
please reach to team for any issues.

Code:
uuencode notavailable.txt notavailable.txt | mailx -m -s "Files are available" arun@trival.com < notavailabltext.txt

# 2  
Old 09-07-2015
Hello arun888,

You can use following.
Code:
 cat Input_file | uuencode Input_file | mailx -s"test" ravinder.singh@chumma.com

Make sure you have uuencode command in your box.


Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
# 3  
Old 09-07-2015
hi ravi,

I am using hp unix.

My requirement is i need to attach a file and body of the email also need to be triggered.

could you please provide the syntax again.

---------- Post updated at 07:38 AM ---------- Previous update was at 07:36 AM ----------

Code:
cat notavail.txt | uuencode notavailable.txt notavailable.txt | mailx -m -s "Files are not available"  test@sample.com

I have tried the above syntax
# 4  
Old 09-07-2015
Hi,

you feed notavail.txt to uuencode and then feed uuencodes output too mailx. You do not see any email body because only the encoded content of your textfile arrives at mailx. For a mail body use something like this:
Code:
( cat notavail.txt ; uuencode notavailable.txt notavailable.txt ) | mailx -m -s "Files are not available"  test@sample.com

This User Gave Thanks to cero For This Post:
# 5  
Old 09-08-2015
hi cero,

Your syntax worked as i expected.

Currently one problem i am facing is. the format looks different in unix end and format looks in different in notepad as well.currently the file is appending in the same line. could you please let me know if it is need to be appended in the next line what needs to be done.

current syntaxt:

Code:
echo "$i" >>available.txt
else
echo "$i" >>notavailable.txt
fi

Please let me know how to change the syntax to be appended in the new line.

---------- Post updated at 12:43 AM ---------- Previous update was at 12:29 AM ----------

in the unix side the format is like the lines are printing in the second line.
whereas in the attachment. it looks like all the lines are printed in the same line.
Expected output is in notepad it should like the lines are printed in the next line.
# 6  
Old 09-08-2015
There are different line terminators in the unix and the windows world. To add the line endings windows editors understand there are 2 ways:
Create the text with the needed endings:
Code:
printf "First line\r\n" >>available.txt
printf "Second line\r\n" >>available.txt

Convert the line endings: if the tool unix2dos is availabe it is the easiest and most self descriptive way. If it's not installed tools like sed can be used (there may be better/more elegant ways than below - you'll find lots of examples when you search this site):
Code:
sed -e 's/$/\r/' notavailable.txt

This User Gave Thanks to cero For This Post:
# 7  
Old 09-10-2015
Hi Cero,

Thanks for your help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mailx Email Issue

Hello, I am facing an issue with email in Linux. I am using mailx command to send email. When I give invalid domain address then it is taking both sender and recipient as sender email and trying to send email. Below is my command echo -e "${EMAIL_TEXT}" | mailx -v -s "${SUBJECT}" -r... (5 Replies)
Discussion started by: yuvi
5 Replies

2. Shell Programming and Scripting

Issue with email sent from Linux server

I have written a shell script to send email to users with message body and attachment. Message body has registered symbol. But when I receive the email, registered trademark symbol has a special character prefixed and appears carlington work® whereas I am expecting to see only carlington work® .... (3 Replies)
Discussion started by: Leo87
3 Replies

3. Programming

Perl - EMail issue - NEED Help

I have a perl that is sending emails in a bad format: "begin 644 Included.doc M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ M*BHJ*BHJ*BHJ*BH*4U5#0T534T953"!-1$XG<R!F;W(@07)C:&EV92!022`M M($-A;F-E;`HJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ... (1 Reply)
Discussion started by: mrn6430
1 Replies

4. Shell Programming and Scripting

UNIX email issue

Hi all, I have tried to send an email with the below script. but i am not getting the subject of the email where it is present in the simply.txt. I am using HP UNIX server. I am not sure what mistake i made in the below unix command. any help would be appreciated. cat simply.txt ... (2 Replies)
Discussion started by: arun888
2 Replies

5. Forum Support Area for Unregistered Users & Account Problems

Email address change issue

Hi Neo/Scott, I decided to change my email address in my details from my earlier one to the one I got with my VIP membership. After the change, I got a message that I'll receive an activation link at the new address to re-activate my account. I haven't got that link till now. Also, all my... (3 Replies)
Discussion started by: elixir_sinari
3 Replies

6. 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

7. Emergency UNIX and Linux Support

AIX: Production email issue

Hello, system generated emails sent to users from production scripts within Aix arent going out. In the errpt -a output I see: _______________________________________________________ LABEL: SRC_SVKO IDENTIFIER: BC3BE5A3 Date/Time: Tue Mar 13 16:28:07 EDT 2012 Sequence... (2 Replies)
Discussion started by: NycUnxer
2 Replies

8. Shell Programming and Scripting

send email issue in unix

Hi, I am trying to send the contents of a file as email in unix.I am using the below code to do this.But when i get the email i see that SUBJECT and TO is blank. Can you please let me know why it is blank? Also the FROM address comes as admin@myhost. Is there any way i can set FROM to user... (5 Replies)
Discussion started by: vignesh53
5 Replies

9. Shell Programming and Scripting

Crontab issue: getting email but with out body

I have a oracle sh script test.sh #!/bin/bash R=`sqlplus -S *****/*********@dfsdf <<ENDOFSQL set serveroutput on size unlimited; execute DBMS_SNAPSHOT.REFRESH( '"MIS_ADMIN"."MV_SURVEY_UNITS_CENSUS"','F'); execute DBMS_SNAPSHOT.REFRESH( '"MIS_ADMIN"."MV_SURVEY_UNITS_CENSUS_PART"','F');... (1 Reply)
Discussion started by: ramkia6
1 Replies

10. Solaris

Crontab email issue

Hi, I have a script that sends a db extract file as an email attachment. I have a crontab created to run it everyday at 8 am.. 00 08 * * * ksh /home/rtaaa/tbasd/report.sh > /home/rtaaa/tbasd/logs/report.log When i just run the "ksh /home/rtaaa/tbasd/report.sh >... (5 Replies)
Discussion started by: ryannam
5 Replies
Login or Register to Ask a Question