sendmail command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers sendmail command
# 1  
Old 09-24-2002
sendmail command

Hi I am using the sendmail command for sending mails.
I have a requirement where i call this sendmail command
with the mail text.However this mail should be delivered
to the recipients only 15 minutes later.Till that point of time
it should be in the queue.Is it possible.If so what should i
pass as parameter to the sendmail command.
# 2  
Old 09-25-2002
hi
use -q time option
-q[time]
Process saved messages in the queue at given intervals. If time is omitted, process the queue once. time is given as a tagged number, with s being seconds, m being minutes, h being hours, d being days, and w being weeks. For example, -q1h30m or -q90m would both set the timeout to one hour thirty minutes.
raju
# 3  
Old 09-25-2002
sendmail

This is what i do .
In a perl script i do the following

$ENV{PATH} = "/bin:/usr/bin";
open(MAIL, "| /usr/lib/sendmail -q1m")
or print "Cannot open send_mail";
print MAIL "To: $recipients\n";
print MAIL "From: $G_thirdparty_admin_email\n";
print MAIL "Subject: $subject \n\n";
print MAIL "$contents\n";
close MAIL;

I expect the mail to be sent after 1m but it does not seem to work
# 4  
Old 09-26-2002
Try using -t as well...

From man page:
Quote:
Read message for recipients. To:, Cc:, and Bcc: lines will be
scanned for recipient addresses. The Bcc: line will be deleted
before transmission.
# 5  
Old 09-26-2002
The -q option is for retries in sending the mail. It will try immediately to send the mail, and if it could not, it would try again at the interval you set in -q. If -q isn't set, then it tries only once, immediately.

If sendmail is running on the system, it might be that if you used -q in the command and it failed to go, that the normally running sendmail process (one started on boot) could grab the message later to attempt to send (Not positive on this point but my testing shows this to be true - I disabled DNS to insure the email could not go but then the normally running sendmail will try every 15 minutes to send again).

If you don't want to send the mail now, then putting in a sleep command or scheduling an at job in a minute from now might be what you would want to do. Looking in the mailx and sendmail programs, I found nothing to delay sending a message. Possible that some other mail client could do this (like pine)

Added note: This may be something to help you out but would be changing how you send all mail possibly. local versus remote mail

Last edited by RTM; 09-26-2002 at 11:08 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sendmail command truncating to list

Hey Folks - I'm trying to pass a list of To address using sendmail command but upon executing the script the to list gets truncated and not able to send the last sender : -bash-4.3$ ./akt.sh Date : 03-JUL-18 aaaaa.sss#bgttecre.bom trcikant.shrivas#bgttecre.bom abc#xyz.bom pqr#lmn.bom lion... (0 Replies)
Discussion started by: vyomdev
0 Replies

2. Red Hat

-bash: sendmail: command not found

Hello Experts, I have been trying to send a test mail in our linux server with sendmail command.But I am getting command not found error message. -->when I tried whether sendmail installed or not with the command rpm -qa sendmail* I got the below, sendmail-cf-8.14.4-8.el6.noarch... (26 Replies)
Discussion started by: Devipriya Ch
26 Replies

3. UNIX for Advanced & Expert Users

Regarding help in sendmail command

Hello All, I have a query here. I want to send an email by sendmailcommand in BASH. So email should have body(by reading a Input_file) in it as well as it should send same Input_file as attachment too. To do so I have tried as following. sendmail_touser() { cat - ${Input_file_HTML} << EOF |... (5 Replies)
Discussion started by: RavinderSingh13
5 Replies

4. Shell Programming and Scripting

Sending attachment using sendmail command

Send_Mail() { C_Date=`date +"%m/%d/%Y"` #Subject="MMDB Load Job Status" for i in `cat $Metafile` do if then email_address=`echo $i | cut -d":" -f2` /usr/lib/sendmail "$email_address" < $Email_File fi done } this is the send mail command i am using .please let me... (1 Reply)
Discussion started by: Alok K Yadav
1 Replies

5. AIX

How to send attachment using "sendmail" command or without uuencode command

Hi Guys, I dont have uuencode, mutt, base64 command available on my aix machine there is any alternative way to send file as attachement in mail. (1 Reply)
Discussion started by: ns64110
1 Replies

6. UNIX for Dummies Questions & Answers

Does the mail command use sendmail?

The question is, Does the mail comman actually send using sendmail or something else? So I am trying to test if sendmail is set up. I used... cat testemail.txt | mail -s "test mail" myemail@test.com I used my email though I didn't get an error, but didn't get the email either. ... (2 Replies)
Discussion started by: wondernate
2 Replies

7. UNIX for Dummies Questions & Answers

Sendmail command options question

Hello, I am trying to use sendmail with spesific usage I am trying to tail a file and send it from an address to my personal mail I am doing so with this command: tail -c 60000 test | sendmail -f sender@domain.com my@mail.com This is working great. I am trying to add this command a... (4 Replies)
Discussion started by: Amit86
4 Replies

8. UNIX for Advanced & Expert Users

Sendmail with attachment command line ?

hi.. Could somebody guide me how to send mail with attachment using sendmail command in unix ? Thank you, (2 Replies)
Discussion started by: bh_hensem
2 Replies

9. Shell Programming and Scripting

Command line problems with sendmail

I cannot get this shell script to work. The path to sendmail is correct... #!/bin/bash echo -e "Subject: email subject\n\nemailbody" | /usr/sbin/sendmail -F fromemail@somedomain.com -t recipientemail@somedomain.com (1 Reply)
Discussion started by: limmer
1 Replies

10. UNIX for Advanced & Expert Users

Sendmail command

Can anyone tell me? How can i attach the file using sendmail command? Give me one example. (2 Replies)
Discussion started by: kingganesh04
2 Replies
Login or Register to Ask a Question