telnet smtp and email in batch


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers telnet smtp and email in batch
# 1  
Old 03-06-2008
telnet smtp and email in batch

I can do the following steps on my UNIX box interactively, but cannot send an email with a script. Can someone help? I need to send an email or some other notification when a cron job fails.

telnet xx.yy.zz.ww 25
helo
mail from: 123@123.com
rcpt to: my@email.net
data
subject: email test
the dog
is in
the house
.
quit

Any other suggestions to solve my failed cron message problem.
# 2  
Old 03-06-2008
Quote:
Originally Posted by ejaggers
I can do the following steps on my UNIX box interactively, but cannot send an email with a script. Can someone help? I need to send an email or some other notification when a cron job fails.
Code:
@hourly /usr/local/bin/doit || (echo "the dog is in the house" | mail -s "email test" my@email.net)

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

UNIX script with smtp and telnet

hi, i have a problem , I'm creating a script that send a mail with telnet . via command line it's ok,but i create the .sh i have problem . this a .sh telnet open mysmtp 25 HELO sleep 15 MAIL FROM:<Email> sleep 15 RCPT TO:<email> sleep 15 DATA SUBJECT : PROVA (3 Replies)
Discussion started by: cescofran76
3 Replies

2. UNIX for Dummies Questions & Answers

send an email from batch file

My batch files run every day, it moves files from servers to my local computer, can I have a confirmation email sent to me from this batch file saying if the job failed or successes? Thank you for your help! (6 Replies)
Discussion started by: idiazza
6 Replies

3. UNIX and Linux Applications

SMTP Server - dump email

Background: I am replicating a set of servers into a "bubble" for testing. Those systems cannot be aware they are in a "bubble" so I must replicate all external services. I have successfully replicated most of those services except SMTP. I would like to configure an SMTP server that collects... (0 Replies)
Discussion started by: NFN_NLN
0 Replies

4. AIX

Enable send email through smtp - exchange on AIX 6.1

Please help, i can not to send email from AIX 6.1 to outside network through STMP - Exchange. Any one can help ? (1 Reply)
Discussion started by: ichsan
1 Replies

5. UNIX for Dummies Questions & Answers

How to block FTP ,SMTP,Telnet services?

My distribution details. # lsb_release -a LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: EnterpriseEnterpriseServer Description: Enterprise Linux Enterprise Linux Server release 5.2 (Carthage) Release: 5.2 Codename: ... (13 Replies)
Discussion started by: pinga123
13 Replies

6. Shell Programming and Scripting

Automating mailing via telnet to smtp

Hi, I am trying to write a ksh script to send an attachment via telnet to an SMTP server. I'm using MKS Toolkit. mail, mailx, sendmail, nc are not working on the server where I have MKS Toolkit installed. If I type the following from the command prompt I receive an email: telnet x.com... (0 Replies)
Discussion started by: dukeEarth
0 Replies

7. Shell Programming and Scripting

telnet smtp script

Hi, I have a mysql backup script located in crontab. I need to inform system administrator if the backup fail by telnet to smtp to send failure notification. ANyone got clue on how to achieve that? cheers. (4 Replies)
Discussion started by: bulkbiz
4 Replies

8. UNIX for Dummies Questions & Answers

Telnet in batch file

hi how can i connect to a telnet session using the unix script... need to create a batch file which has to run daily. first it has to telnet to a IP then execute certain commands and log the session. thanks Aemu (1 Reply)
Discussion started by: aemunathan
1 Replies

9. UNIX for Dummies Questions & Answers

Send email using Exchange as SMTP

Hi. I have a Tru64 Unix V5.1 server that I would like to send emails using an exchange server we have on the same network as the smtp of this machine. What are the requirements/configuration that I need to do in order to make this possible. We are planning on emailing error messages and such from... (2 Replies)
Discussion started by: fidodido
2 Replies
Login or Register to Ask a Question