How to set Subject in Sendmail in Crontab


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to set Subject in Sendmail in Crontab
# 8  
Old 12-10-2010
Code:
00 8 * * * date '+%Y%b%d' | echo "Testing for $1" | cat - /home/file1.out | /usr/sbin/sendmail -t name@xxx.co.uk

R0H0N
# 9  
Old 12-10-2010
No Rohan, this command is not working at all. :-(
# 10  
Old 12-10-2010
What error u r getting?

Try

Code:
00 8 * * * echo "Testing for "`date '+%Y%b%d'` | cat - /home/file1.out | /usr/sbin/sendmail -t name@xxx.co.uk

R0H0N
# 11  
Old 12-10-2010
Quote:
00 8 * * * echo "Testing for "`date '+%Y%b%d'` | cat - /home/file1.out | /usr/sbin/sendmail -t name@xxx.co.uk
This has gone way beyond a crontab line and should be a script.
The above cron line will give trouble if run directly from cron because it contains unquoted "%" signs which have special meaning to cron (see "man crontab").

There are examples of various "mailx" and "sendmail" ideas in this recent post (one of many similar posts).

https://www.unix.com/shell-programmin...-script-4.html


The actual commands and syntax you use will depend on what Operating System and Shell you have available.
You are in an area where there is much variety of syntax.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Set crontab for 4th and 25th of every month?

Hello, I wanted to set Crontab for 4th and 25th of every month at 5:00 PM. Script should take previous month and current year as command line arguement like... /home/test1.sh -f ABCD 03 2014 so above script will run on 4th and 25th April 2014 but argument should be like previous month... (11 Replies)
Discussion started by: ajju
11 Replies

2. AIX

Set email Priority using sendmail

Hi everyone, I'm trying to send an email on unix using sendmail command. For setting the priority to high I use: X-Priority: 1 And it works on HP but when I tried it on AIX the email is sent but no priority!! Anyone can help me Thanks in advance, Hiposh (3 Replies)
Discussion started by: hiposh
3 Replies

3. UNIX for Dummies Questions & Answers

nLocal sendmail issues when hostname not set in official domain name

Hi, I'm having issues with sendmail when I try to send host to host mail. I've had to change the "my official domain name" line to mycompany.com to get the mails through the external spam filter, when a mail was sent with hostname.mycompany.com it was blocked. I had to change the Dj macro... (0 Replies)
Discussion started by: elcounto
0 Replies

4. Solaris

mailx/sendmail configuration/set up problem

Hello Good People of Linux World!!! Background: Recent Networking Graduate, thrown in line of fire. For the past couple of days I have been searching online for answers and haven't gotten anywhere regarding Mailx, Sendmail functionality on SunOS 5.9. My dilemma: Mailx / sendmail are... (28 Replies)
Discussion started by: kazmiM
28 Replies

5. Red Hat

Set up Sendmail as sending only server

I have set up where my primary fibre optical WAN access does not have any sending SMTP service but my fall-back ADSL service does. However, with most Internet Service Providers, the SMTP service access is "locked" to the IP addresses that the service knows about. Therefore I can not send SMTP... (0 Replies)
Discussion started by: smlunatick
0 Replies

6. Shell Programming and Scripting

How to set crontab for different Time Zone

Hi, I want to set cron job for different time zone from my machine. So here is what I did to set it. I am having a file cronfile, which I use to set cron jobs by using Crontab cronfile Now in cronfile I set TZ variable as Set TZ=Asia/Calcutta But now... (3 Replies)
Discussion started by: sarbjit
3 Replies

7. Shell Programming and Scripting

Unable to populate subject field of the email while using sendmail

Hi, Can anyone kindly provide some information about how to populate the subject field of the email while using the sendmail utility ? Itried the following command line argument : echo -e "Body of the email" | /usr/lib/sendmail -f from@from.com -t to@to.com -s " Subject of the email" ... (4 Replies)
Discussion started by: sdiptanil
4 Replies

8. UNIX for Dummies Questions & Answers

How to set HIGH importance to a mail sent through mailx or sendmail command

I have written a script for sending automated email, reporting the running status of a cron scheduled work. Now, the issue is, my Project Manager wants, the mail should be received with HIGH IMPORTANCE. How can I do that, kindly anybody explain. Thank you so much. (3 Replies)
Discussion started by: mitte_dino
3 Replies

9. Shell Programming and Scripting

sendmail subject

what is the syntax for sending a subject ? sendmail -t a@b.com The person receives the mail with an empty subject! the man pages dont give anything related to subject...anybody?? (11 Replies)
Discussion started by: wannalearn
11 Replies

10. Shell Programming and Scripting

sendmail subject to append dynamically.

Hi, I have to use sendmail from command line, and we need to append a static string in subject to a new value from file.Is there any way to do it. Thanks Shrikrishna (1 Reply)
Discussion started by: shrikrishna
1 Replies
Login or Register to Ask a Question