•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,448 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,633 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 1896 | Replies: 2
![]() |
•
•
Join Date: Oct 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
I tried to Sends email but somehow email not getting out, please help me how I can write shell script in right manner. Thanks and regards
This is the one I tried my end.
Script:
#!/bin/sh
set wma = `grep -i "java" sampletest`
echo $wma
mail -v -s "ALERT" tamilmercy@yahoo.com < alertfile
Result:
r.invoke.InvokeManager.process(InvokeManager.java:612) :i
tamilmercy@yahoo.com... Connecting to [127.0.0.1] via relay...
tamilmercy@yahoo.com... Deferred: Connection refused by [127.0.0.1]
This is the one I tried my end.
Script:
#!/bin/sh
set wma = `grep -i "java" sampletest`
echo $wma
mail -v -s "ALERT" tamilmercy@yahoo.com < alertfile
Result:
r.invoke.InvokeManager.process(InvokeManager.java:612) :i
tamilmercy@yahoo.com... Connecting to [127.0.0.1] via relay...
tamilmercy@yahoo.com... Deferred: Connection refused by [127.0.0.1]
•
•
Join Date: Oct 2007
Posts: 306
Reputation:
Rep Power: 2
Solved Threads: 29
Hey There,
The last line of your script is actually okay. The error you're getting looks like it's coming from sendmail. Depending on what version you're running you may need to edit /etc/mail/sendmail.cf or /etc/mail/submit.cf and specify the IP of the host in DaemonPortOptions - It's either that or ClientPortOptions.
In any event, your script is okay. Looks like sendmail won't send mail no matter what you do right now.
If you invoke
/usr/lib/sendmail -v tamilmercy@yahoo.com
and can post that output, I might be able to tell you what you need to do to make your mail work
Also - you can run
/usr/lib/sendmail -vb tamilmercy@yahoo.com
if you want to get the verbose output but not actually send the mail.
Thanks
, Mike
The last line of your script is actually okay. The error you're getting looks like it's coming from sendmail. Depending on what version you're running you may need to edit /etc/mail/sendmail.cf or /etc/mail/submit.cf and specify the IP of the host in DaemonPortOptions - It's either that or ClientPortOptions.
In any event, your script is okay. Looks like sendmail won't send mail no matter what you do right now.
If you invoke
/usr/lib/sendmail -v tamilmercy@yahoo.com
and can post that output, I might be able to tell you what you need to do to make your mail work
Also - you can run
/usr/lib/sendmail -vb tamilmercy@yahoo.com
if you want to get the verbose output but not actually send the mail.
Thanks

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
•
•
Join Date: Oct 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Thanks for your kind reply. I like to write script as follow:
The script to be checked
- “error” message in current server log file
- If found error message than send alert email to system admin email address
I need to be checked on current date -<serverYYMMDD.log> file under log directory if anything “error” message appeared.
please help me out how I can write this type of script. Thanks
The script to be checked
- “error” message in current server log file
- If found error message than send alert email to system admin email address
I need to be checked on current date -<serverYYMMDD.log> file under log directory if anything “error” message appeared.
please help me out how I can write this type of script. Thanks
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
advertisment animations browser cell email encryption eu eudora firefox flash gmail google imap interactivity. microsoft mobile mozilla multimedia news onecare open source opinion outlook penelope phishing phones professional research scam scripting security spam spammers spamming stocks technology thunderbird virus web web development webmail
- Using Shell Script how to send mail automatically (Shell Scripting)
- Sending email from a shell script (Shell Scripting)
- Change Password In A Shell Script (Shell Scripting)
- shell script for number sequence--- anybody help me? (Shell Scripting)
- Linux Shell Script needs help writing program (Shell Scripting)
- simple shell script....complex migraine (Shell Scripting)
Other Threads in the Shell Scripting Forum
- Previous Thread: Giving input to a c++ file
- Next Thread: Paste files in order and columns


Linear Mode