943,670 Members | Top Members by Rank

Ad:
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Aug 1st, 2005
0

Re: Sending email from a shell script

Hey Shanenin,

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

Thanks,

RexWint
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rexwint is offline Offline
2 posts
since Jul 2005
Aug 1st, 2005
0

Re: Sending email from a shell script

I personally have never used mail or sendmail.
Reputation Points: 10
Solved Threads: 17
Posting Whiz in Training
shanenin is offline Offline
217 posts
since May 2005
Oct 27th, 2007
0

Re: Sending email from a shell script

Click to Expand / Collapse  Quote originally posted by leoman ...
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
Reputation Points: 53
Solved Threads: 33
Posting Whiz in Training
bugmenot is offline Offline
224 posts
since Nov 2006
May 8th, 2008
0

Re: Sending email from a shell script

Click to Expand / Collapse  Quote originally posted by YUPAPA ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mithun.kamath is offline Offline
2 posts
since May 2008
May 8th, 2008
0

Re: Sending email from a shell script

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
Reputation Points: 102
Solved Threads: 47
Posting Whiz
eggi is offline Offline
399 posts
since Oct 2007
Jun 26th, 2009
0

Re: Sending email from a shell script

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
oppiet30 is offline Offline
1 posts
since Jun 2009
Jun 26th, 2009
0

Re: Sending email from a shell script

Click to Expand / Collapse  Quote originally posted by oppiet30 ...
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.
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Jun 27th, 2009
0

Re: Sending email from a shell script

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.
Reputation Points: -12
Solved Threads: 1
Newbie Poster
KlementHonza is offline Offline
8 posts
since Apr 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: How to pass a shell variable to a perl command
Next Thread in Shell Scripting Forum Timeline: shell script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC