Sending email from a shell script

Reply

Join Date: Jul 2005
Posts: 2
Reputation: rexwint is an unknown quantity at this point 
Solved Threads: 0
rexwint rexwint is offline Offline
Newbie Poster

Re: Sending email from a shell script

 
0
  #11
Aug 1st, 2005
Hey Shanenin,

Is ther a way to use Linux Sendmail or Mail to send a message to an IP address ?

Thanks,

RexWint
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Solved Threads: 16
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: Sending email from a shell script

 
0
  #12
Aug 1st, 2005
I personally have never used mail or sendmail.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 224
Reputation: bugmenot is an unknown quantity at this point 
Solved Threads: 31
bugmenot bugmenot is offline Offline
Posting Whiz in Training

Re: Sending email from a shell script

 
0
  #13
Oct 27th, 2007
Originally Posted by leoman View Post
have written a shell script in which I use fastmail to send emails from the shell script.
It sends email to my company account with no problem. But I wan to send the same email to a pager number so that the pager goes off when the particular condition occurs.
I see that email is not being send to the pager from this script.

I tried sending email from my company email account to the pager email and the pager goes of with the email from company email account.

Any idea why this might be happening so? Is there anything else that I should use to send emails to pager

Thanks!
f
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 2
Reputation: Mithun.kamath is an unknown quantity at this point 
Solved Threads: 0
Mithun.kamath Mithun.kamath is offline Offline
Newbie Poster

Re: Sending email from a shell script

 
0
  #14
May 8th, 2008
Originally Posted by YUPAPA View Post
One command does it all ~ :p

echo "Message Content" | mail -s "Subject goes here" you@domain-name.com
I tried the same but when the mail is send ... The from address is diffirent like <yourlogin@yourmachinename.local>
How to solve this
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Sending email from a shell script

 
0
  #15
May 8th, 2008
Hey There,

You can try piping everything to sendmail -t (mail and mailx use sendmail). The -t flag means you have to specify headers, though, so:

Shell Scripting Syntax (Toggle Plain Text)
  1. (echo "Subject: My Subject";echo "From: my@address.com";echo "To: your@address.com";echo "Reply-To: my@address.com";echo "X-Whatever: Any Other Headers You Want To Include";echo CONTENT;cat FILE)|/usr/lib/sendmail -t

sendmail might be in /usr/sbin/ also.

All the header information, CONTENT and FILE are just placeholders. Hopefully that will help you out. You may see an error in your syslog that the "sender was forced with -f" but that should be okay unless your mailserver won't accept it.

Best wishes,

Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 1
Reputation: oppiet30 is an unknown quantity at this point 
Solved Threads: 0
oppiet30 oppiet30 is offline Offline
Newbie Poster

Re: Sending email from a shell script

 
0
  #16
Jun 26th, 2009
I would like to send mail to myself using a for loop.
Like I would like to send email to myself 100 times with a bash shell script. I use to have a script that does this, but I seem to have lost it.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,170
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 565
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: Sending email from a shell script

 
0
  #17
Jun 26th, 2009
Originally Posted by oppiet30 View Post
I would like to send mail to myself using a for loop.
Like I would like to send email to myself 100 times with a bash shell script. I use to have a script that does this, but I seem to have lost it.
This thread is over four years old. Please start a new thread to ask your questions.
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 8
Reputation: KlementHonza has a little shameless behaviour in the past 
Solved Threads: 1
KlementHonza KlementHonza is offline Offline
Banned

Re: Sending email from a shell script

 
0
  #18
Jun 27th, 2009
I am trying to write a shell script that evaluates the size of each user's home directory and if it is greater than 50 MB I want an email to be sent to their user account telling them that they need to reduce the size of their home directory.

url=http://"www.accessbit.com"Atlanta Professional Web Development[/url]
Last edited by KlementHonza; Jun 27th, 2009 at 4:02 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC