943,394 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Dec 8th, 2004
0

Sending email from a shell script

Expand 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!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
leoman is offline Offline
2 posts
since Dec 2004
Dec 8th, 2004
0

Re: Sending email from a shell script

What's the script? (be sure to edit out the email addresses)

I usually just use sendmail directly, like this:

sendmail email@domain.com < ~/maildir/mailmessage

and that works out just fine, never had a problem. You could even use a variable if you wanted:

sendmail $email_addy < ~/maildir/mailmessage

That's always worked for me, assuming that your MTA is sendmail, or it is at least available.
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003
Dec 9th, 2004
0

Re: Sending email from a shell script

Thanks for your reply.
I tried using sendmail and it gave me error --

sendmail: not found

How can I solve this?

Thanks!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
leoman is offline Offline
2 posts
since Dec 2004
Dec 10th, 2004
0

Re: Sending email from a shell script

Quote originally posted by leoman ...
Thanks for your reply.
I tried using sendmail and it gave me error --

sendmail: not found

How can I solve this?

Thanks!
Install sendmail? try using mail instead of sendmail, too.
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003
Jan 24th, 2005
0

Re: Sending email from a shell script

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.
could you please post your script
Reputation Points: 10
Solved Threads: 0
Newbie Poster
heema is offline Offline
1 posts
since Jan 2005
Jan 28th, 2005
0

Re: Sending email from a shell script

One command does it all ~ :p

echo "Message Content" | mail -s "Subject goes here" you@domain-name.com
Reputation Points: 10
Solved Threads: 0
Light Poster
YUPAPA is offline Offline
42 posts
since Dec 2004
Jan 31st, 2005
0

Re: Sending email from a shell script

Hi Leoman,
I dont know the solution of this problem and i want a help form you that how to send email from shell script on linux to other email accounts. Can u send me the code at sanju456@rediffmail.com. Sanjeev
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sanju456 is offline Offline
2 posts
since Jan 2005
Apr 18th, 2005
0

Re: Sending email from a shell script

Hi,

I have the same problem as Leoman. I am unable to see the solution on the forums.
This is my scenario:
I am trying to send an email to a pager through the shell script on linux. I am able to send an email to an email address from my script as well as from the command line. But, using the same mail command to page myself, fails. Nothing really happens. I don't get paged either from the command line or from my script.
Following is my command :
print "$user, $MESSAGE, $SERVER, `date`" | mail -s "Application $LEVEL PROBLEM" $pager_number
when I replace pager_number with an email address, it works perfectly but when I replace it with a pager number in the format pagernumber@skytel.com , nothing happens.
Can somebody please help ?

Thanks
Deepika
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dmellach is offline Offline
1 posts
since Apr 2005
Jul 31st, 2005
0

Re: Sending email from a shell script

I have been able to send email from the command line to localhost.localdomain, but when I try to send to my own email account at mindspring.com. it does not deliver to my email inbox. Instaed, I get an error message from mindspring.com that says:

Diagnostic-Code; SMTP: 550 Dynamic IPs/open relays blocked
Contact <openmailrelay@abuse.earthlink.net>

Anybody know a way to get around this and get my message deliverd to my inbox at mindspring.com ?

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

Re: Sending email from a shell script

it seems earthlink is trying to prevetn spam. That may be tough to get around
Reputation Points: 10
Solved Threads: 17
Posting Whiz in Training
shanenin is offline Offline
217 posts
since May 2005

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