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)
# 8  
Old 04-22-2010
Good that you can get the email. Looks like your MTA does not like heavy emails. I guess the file is not too big. Check the size email.report

Code:
$ du -h email.report

if your "du" does not like -h option just try without it.

If you see the size of file is too big in GB's then size is the problem. If size is not too big then example less than 20-30 MB then there might be some other problem.

Also check the logs of your MTA usually in /var/log/sendmail etc etc ...

Two ways to solve: (I like 2nd way)

1. Try the max number of lines your MTA likes

Code:
$ tail  -n 1000 email.report | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com 
# increase 1000 in step of 1000 till the time you dont get email. 
# Also can try with size check main tail

Method 2:
If you still need the file in email and dont mind as attachment try this

Code:
$  tar zcvf email.report.tgz email.report
$ uuencode email.report.tgz email.report.tgz | mailx -s $REQ_SUBJECT -h 5 abc@xyz.com

# 9  
Old 04-22-2010
Hi chakrapani,

when i check
Code:
 du email.report

i got the below o/p

Code:
8       email.report

then i tried with ur 2nd method of tarring and sending it as attachment but to my badluck i didnot get the email Smilie

---------- Post updated at 10:31 PM ---------- Previous update was at 10:26 PM ----------

all these days it was working fine y all of a sudden it happened like this? is there any space problem?? i dont know much about unix ... i just use this tool for sending auto email after completing my work...

if i just type mail in my unix prompt i can see lots of old mails... do u think that is creating problem??

---------- Post updated at 10:33 PM ---------- Previous update was at 10:31 PM ----------

and about your first method i didnot get mail in the first attempt itself i mean for 1000 itself i didnot get the mail Smilie
# 10  
Old 04-22-2010
Yes, it could be a problem.
check if the mail daemon is running properly or not. Do a
Code:
ps -ef | grep mail

mail and paste the o/p.
May be you shoud contact your unix admin and have the mail daemon restart.

Last edited by devtakh; 04-22-2010 at 03:48 AM.. Reason: code tag
# 11  
Old 04-22-2010
it will work only till 85... not more than that imean tail -n 85..... Smilie

---------- Post updated at 10:50 PM ---------- Previous update was at 10:49 PM ----------

Quote:
Originally Posted by devtakh
Yes, it could be a problem.
check if the mail daemon is running properly or not. Do a
Code:
ps -ef | grep mail

mail and paste the o/p.
May be you shoud contact your unix admin and have the mail daemon restart.

this is the output..

Code:
9287 27604  0 02:49:27 pts/32    0:00 grep mail

# 12  
Old 04-22-2010
Well, it doesn't look like your mail process is running at all. You should request the admin to start it.

try to send a simple email and see if it is working

Code:
mailx -s "Testing" youremail@adress.com

also do a

Code:
which mailx

and used the absolute path of the mailx command and try again.
# 13  
Old 04-22-2010
if i send only the below the command i ll get the mail..


Code:
tail -n 85 email.report | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com

but note that only till 85 i ll get the mail..if i change that to 86 or more i wont get the mail...!
# 14  
Old 04-22-2010
ok, i see.

can you try
Code:
/usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com < email.report

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