Problem with sending email(to include contents of text file)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with sending email(to include contents of text file)
# 1  
Old 04-21-2010
Problem with sending email(to include contents of text file)

Hello,
I was using a shell script for sending contents of a text file(email.report) to different users.
I was using the below command in my script to send email...
Code:
cat email.report | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com

It was working fine all these days but now all of a sudden it stopped to send emails...
when i treid to send the mail using below command I will get the mail within a sec.
Code:
echo "Hi" | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com

but when I tried include the contents of the text file(as shown in the first code) the mails are not going.
What may be problem?? Why this happend suddenly when the mails are going properly before.. and how to solve this? Pls pls pls help me...
Regards,
Deepak.
# 2  
Old 04-21-2010
When you try to send the report, do you get any errors from the mailx command? What does your local mail-log say?
# 3  
Old 04-21-2010
What is the size of report file? Did you get any error while trying to email the report file?

-Nithin.
# 4  
Old 04-21-2010
try
Code:
tail email.report | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com

# 5  
Old 04-21-2010
i didnot get any errors.. but stil not getting mails... i hv used that script for more than 4 months but all of a sudden it is not sending emails!!!
# 6  
Old 04-21-2010
Well, something must have changed between the mailx command and der recipients mailbox. We have to check all steps to see, where things go wrong.

The first step ist the mailx command, which does not output any errors. OK.

The next is your local MDA. Please check its logfile (like /var/log/syslog on Solaris or /var/log/mail.log on Linux). Are there any traces of your mail in this log, especially if the mail was delivered to the next upstream mailserver? A message like "Mail accepted" would indicate, that the problem is not on the sending server.
# 7  
Old 04-21-2010
@hergp..

i go till /var/mail but i cant find syslog or mail.log file inside of it.... Smilie

---------- Post updated at 06:56 PM ---------- Previous update was at 06:08 PM ----------

Quote:
Originally Posted by chakrapani
try
Code:
tail email.report | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com


tried the above command and got the mail but when i use cat instead of tail i wont get... i want full contents of the mail... pls help...

Last edited by smarty86; 04-22-2010 at 01:08 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sending email with file names

i need to send an email to users on the files being loaded...how can i achieve this? say, my source file directory has 2 files file1.txt file2.txt I just want to send an email saying these files were loaded...Please help (1 Reply)
Discussion started by: saggiboy10
1 Replies

2. Shell Programming and Scripting

Sending a file as an attachment to email

The file is located under appl/batchdata/ file name: storesales.txt I am using following code because uuencode is not present. I am not getting the data in file but i am getting the blank file with same name as an email attachment. ( echo "from: sch@xxxx.com" echo "to:sch@xxxx.com" echo... (2 Replies)
Discussion started by: skatpally
2 Replies

3. Shell Programming and Scripting

sending email in case of file not found

Hi, In the shell script, i want to do sftp and go to a directory and check if a particular file is present, if not i send an email with some error message. Please guide me about how i could achieve it...." (1 Reply)
Discussion started by: sJohn
1 Replies

4. Shell Programming and Scripting

Attaching .csv file and sending email

I need help with writing a shell script for writing data from a table into a .csv file and send the file has email attachment. I stuck up with attaching the file to the email. Thanks, (1 Reply)
Discussion started by: Beena
1 Replies

5. Programming

perl - problem sending text with delimiter

Hello, i encountered this in perl but it might be command line related as well: i am sending text as an argument to echo command on remote computer. if the text has alphanumeric characters only, say 'hello world' all is well. if however text has metacharachters, e.g. 'hello | world' or even... (2 Replies)
Discussion started by: ole111
2 Replies

6. Shell Programming and Scripting

Not able to attach text in body of email while sending mail with attachment

Hi, We have been trying to send mail with attachment and it is going fine, but when we try to attach a text to the body of the email, we find that the mail is going fine with the body text but the attachment is not going through. We are using ksh. The command that is successfull without the... (6 Replies)
Discussion started by: jmathew99
6 Replies

7. Shell Programming and Scripting

Sending email and attachment file using Perl

I am trying to send an email body of information and also attachment using perl script, but I am only able to send the body but not an attachment. is there around it without using "use MIME::Lite;" module. $user = "bataf\@xyz.com"; $subjectt = "mail from perl"; open(MAIL, "| mailx -s... (1 Reply)
Discussion started by: bataf
1 Replies

8. Shell Programming and Scripting

how to send contents of a file to email as a message

i have a file new1.txt i want to send the contents of that file as a message to email ali@sms.com i m using ksh script......... plz help me (5 Replies)
Discussion started by: ali560045
5 Replies

9. Shell Programming and Scripting

I have some problem in sending an email, please help me.

Hi, I am writing a kornshell script, once the successful completion of the script I need to send an email with body of a text along with an attachment. But i couldnt able to send an email with both body of the text and attachment at the same time in unix. The following is the code i tried, ... (2 Replies)
Discussion started by: Sheethal
2 Replies

10. Shell Programming and Scripting

Sending email with text & attachment using mailx

I spent some time working this out, with a little help from various forums, and thought the community would like to know : Here is how you can send an email from a single Unix command line : /usr/bin/echo "Email text\nNew line\nAnother new line" >x | uuencode sourcefile.txt sourcefile.txt |... (3 Replies)
Discussion started by: haryadoon
3 Replies
Login or Register to Ask a Question