05-09-2013
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
PROVA
CIAO
PROVA
.
QUIT
quit
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
We had an upgrade today morning and since then mailx command is not working.
I have been told to change the DNS to use host name as smtp.companyname.com instead of the IP address.
Can someone please help me out to know where can I change this on a Unix Server.
Thanks
Aman (5 Replies)
Discussion started by: chawlaaman
5 Replies
2. UNIX for Dummies Questions & Answers
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... (1 Reply)
Discussion started by: ejaggers
1 Replies
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. UNIX for Dummies Questions & Answers
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. Fedora
How to setup an smtp server on a unix-based machine. For example ubuntu, mac os x, fedora. (4 Replies)
Discussion started by: 14opsrc
4 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I am trying to figure out how to check SMTP server details on Unix enviornment?
I tried using
echo "hello" | sendmail -v abc@xyz.com
and got following error:
-bash: sendmail: command not found
-bash: echo: write error: Broken pipe
Any help will be much appreciated regarding... (2 Replies)
Discussion started by: palak08
2 Replies
8. Shell Programming and Scripting
I have make an menu in which first option is to start and second is to stop the services
echo "Please enter the appropriate choice for doing the operations"
echo "
1) STOP Services
2) START Services
case $choice in
1)
... (1 Reply)
Discussion started by: punpun66
1 Replies
9. Shell Programming and Scripting
Hello Peoples,
I have a problem wrapping my head around a script that I modified, essentially it uses the postfix smtp line in master.cf to send out a message to two or more email servers, It is a nice way to test different email servers and platforms. Problem with the original script is that it... (0 Replies)
Discussion started by: SeSe
0 Replies
sleep(1) User Commands sleep(1)
NAME
sleep - suspend execution for an interval
SYNOPSIS
sleep time
DESCRIPTION
The sleep utility will suspend execution for at least the integral number of seconds specified by the time operand.
OPERANDS
The following operands are supported:
time A non-negative decimal integer specifying the number of seconds for which to suspend execution.
EXAMPLES
Example 1: Suspending command execution for a time
To execute a command after a certain amount of time:
example% (sleep 105; command)&
Example 2: Executing a command every so often
example% while true
do
command
sleep 37
done
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of sleep: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 The execution was successfully suspended for at least time seconds, or a SIGALRM signal was received (see NOTES).
>0 An error has occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO
wait(1), alarm(2), sleep(3C), wait(3UCB), attributes(5), environ(5), standards(5)
NOTES
If the sleep utility receives a SIGALRM signal, one of the following actions will be taken:
o Terminate normally with a zero exit status.
o Effectively ignore the signal.
The sleep utility will take the standard action for all other signals.
SunOS 5.10 1 Feb 1995 sleep(1)