The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sendmail "root... User address required." error csgonan SUN Solaris 10 04-03-2008 09:57 AM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
How to change "From" in mailx R00tSc0rpi0n UNIX for Advanced & Expert Users 5 09-08-2006 12:47 AM
chmod - "future" changes gmclean2006 UNIX for Dummies Questions & Answers 8 06-15-2006 11:28 AM
How can I deny messaging which use "wall" to send message out? wilsonchan1000 UNIX for Dummies Questions & Answers 7 07-17-2002 10:06 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-09-2007
paqman paqman is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 21
Using mailx to send in the future? Also change "from" address?

Hey, I've got a script using mailx to send an email to the user, but i'd like it if I could have it send the email sometime in the future, not right away. And by future, i mean like 1 minute in the future.

And I don't want it to halt the script in anyway. Perhaps there's a way to have it spawn a process or something that runs for a minute before sending the mail or something?

Also, is there a way to specify the "from" address using mailx? I would rather have a different reply-to address than the system account.
  #2 (permalink)  
Old 08-09-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
How about

Code:
futureMail()
{
   sleep 60
   mailx .....
}


futureMail &
and change the source by changing/adding field that identifies the source of the message, not sure if it's "From" or "ReplyTo".

Last edited by porter; 08-09-2007 at 05:31 PM..
  #3 (permalink)  
Old 08-13-2007
paqman paqman is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 21
Quote:
Originally Posted by porter View Post
How about

Code:
futureMail()
{
   sleep 60
   mailx .....
}


futureMail &
and change the source by changing/adding field that identifies the source of the message, not sure if it's "From" or "ReplyTo".
Thanks! Exactly what i was looking for.
  #4 (permalink)  
Old 11-10-2008
kah00na kah00na is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 79
If you have your "atd" running, you can use this format:


Code:
echo "mailx -s 'subject' e@mail.com << /path/to/file" | at 15:03
This will send the e-mail out at the next instance of "15:03" (3:03 p.m.)... today if it is currently before 15:03, or tomorrow if it is after 15:03.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0