Sending email from a shell script

Reply

Join Date: Dec 2004
Posts: 2
Reputation: leoman is an unknown quantity at this point 
Solved Threads: 0
leoman leoman is offline Offline
Newbie Poster

Sending email from a shell script

 
0
  #1
Dec 8th, 2004
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!
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: Sending email from a shell script

 
0
  #2
Dec 8th, 2004
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.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2
Reputation: leoman is an unknown quantity at this point 
Solved Threads: 0
leoman leoman is offline Offline
Newbie Poster

Re: Sending email from a shell script

 
0
  #3
Dec 9th, 2004
Thanks for your reply.
I tried using sendmail and it gave me error --

sendmail: not found

How can I solve this?

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: Sending email from a shell script

 
0
  #4
Dec 10th, 2004
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.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 1
Reputation: heema is an unknown quantity at this point 
Solved Threads: 0
heema heema is offline Offline
Newbie Poster

Re: Sending email from a shell script

 
0
  #5
Jan 24th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 42
Reputation: YUPAPA is an unknown quantity at this point 
Solved Threads: 0
YUPAPA's Avatar
YUPAPA YUPAPA is offline Offline
Light Poster

Re: Sending email from a shell script

 
0
  #6
Jan 28th, 2005
One command does it all ~ :p

echo "Message Content" | mail -s "Subject goes here" you@domain-name.com
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 2
Reputation: sanju456 is an unknown quantity at this point 
Solved Threads: 0
sanju456 sanju456 is offline Offline
Newbie Poster

Re: Sending email from a shell script

 
0
  #7
Jan 31st, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1
Reputation: dmellach is an unknown quantity at this point 
Solved Threads: 0
dmellach dmellach is offline Offline
Newbie Poster

Re: Sending email from a shell script

 
0
  #8
Apr 18th, 2005
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
Reply With Quote Quick reply to this message  
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
  #9
Jul 31st, 2005
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
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
  #10
Jul 31st, 2005
it seems earthlink is trying to prevetn spam. That may be tough to get around
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