Sponsored Content
Full Discussion: PERL: ping and e-mail
Top Forums Shell Programming and Scripting PERL: ping and e-mail Post 35018 by oombera on Tuesday 25th of March 2003 02:56:05 PM
Old 03-25-2003
Smilie Hmm...

What error message are you getting now? Still the $smtp->mail($from); one?

If not, then you may want to try changing the email addresses inside the emaillist.txt file so that each address has a backslash before the @ symbol as well.. or create a small file and experiment with just a few addresses.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Ping Determine Success or Fail

I know how to ping in Perl. That is easy. What I am wondering is if there is a way for Perl to determine whether the ping was successful or not. Or do I need to save the results out and parse the results seperately looking for the #of tries and successful revieves. Thanks. (1 Reply)
Discussion started by: gdboling
1 Replies

2. Shell Programming and Scripting

Perl telnet to cisco router and compare the ping ms

All Please help, i will telnet to router to obain the ping status and compare, if higher than normal latency, i will have further action.. if i do the telent and in perl script then .... e.g the result i obtain from the router will be =' Success rate is 100 percent (5/5), round-trip... (4 Replies)
Discussion started by: optimus
4 Replies

3. Shell Programming and Scripting

perl ping script

Dear All Any one able been writing any command ping in perl??basically i want to wring ping script to send 1000 packet ping then initiate "Ctrl C' terminal to ping example below:-] #!/usr/local/bin/perl $r=`/bin/ping 172.23.11.254`; Thank You ---------- Post updated at 10:27 PM ----------... (2 Replies)
Discussion started by: netxus
2 Replies

4. Shell Programming and Scripting

perl return ips after successful ping

Hi, I have this script in ksh, what it does is loop every ip in the nodes_nso and produced another variable up_nodes_nso of only ip's that are up. nodes_nso=$(cat /var/tmp/nodes.txt) echo "ICMP Tests:" up_nodes_nso="" for ip in ${nodes_nso} ; do ping ${ip} 3 > /dev/null if ; then ... (1 Reply)
Discussion started by: borderblaster
1 Replies

5. Programming

Perl Ping Loop

Hi All i have an issue with ping, we are using dhcp and so if the machine has been offline and i ping it, i get " ping: unknown host <hostname> is there a way i can stick a loop somewhere so it would keep trying when it got the unknown host error and then when the machine came back online... (2 Replies)
Discussion started by: ab52
2 Replies

6. Shell Programming and Scripting

Ping and Perl

Hi There i have little situation that i could us some help with. We have a dhcp server, but the problem is if that a machine has been offline for a while it loose it's lease and so if you ping it you get unknown host if there a way using perl that it will continue to try and ping it, even tho... (1 Reply)
Discussion started by: ab52
1 Replies

7. Shell Programming and Scripting

Animation Ping on Solaris Like Cisco Ping

Hi, I develop simple animation ping script on Solaris Platform. It is like Cisco ping. Examples and source code are below. bash-3.00$ gokcell 152.155.180.8 30 Sending 30 Ping Packets to 152.155.180.8 !!!!!!!!!!!!!.!!!!!!!!!!!!!!!. % 93.33 success... % 6.66 packet loss...... (1 Reply)
Discussion started by: gokcell
1 Replies

8. Shell Programming and Scripting

Perl : ping for multiple IPs not working

I have written perl ping program to ping list of IPs one by one and print the status.But each and every time it is showing the status as Pass for all IPs even though the IP is wrong. multipleip.pl use Net::Ping; $p = Net::Ping->new(); $ifile="inventory.txt"; ... (2 Replies)
Discussion started by: scriptscript
2 Replies

9. Shell Programming and Scripting

Perl : code on ping showing difference result

Hi all, I am using the below code to ping a code and print whehter the connection is successful or not. use Net::Ping; $p = Net::Ping->new(); my $host = "x.x.x.x"; # print "$host is alive.\n" if $p->ping($host); if ($p->ping($host,3)) { print... (0 Replies)
Discussion started by: scriptscript
0 Replies

10. Programming

Ping test sends mail when ping fails

help with bash script! im am working on this script to make sure my server will stay online, so i made this script.. HOSTS="192.168.138.155" COUNT=4 pingtest(){ for myhost in "$@" do ping -c "$COUNT" "$myhost" &&return 1 done return 0 } if pingtest $HOSTS #100% failed... (4 Replies)
Discussion started by: mort3924
4 Replies
smtp(n) 							    smtp client 							   smtp(n)

__________________________________________________________________________________________________________________________________________________

NAME
smtp - Client-side tcl implementation of the smtp protocol SYNOPSIS
package require Tcl package require mime ?1.5.4? package require smtp ?1.4.5? ::smtp::sendmessage token option... _________________________________________________________________ DESCRIPTION
The smtp library package provides the client side of the Simple Mail Transfer Protocol (SMTP) (1) (2). ::smtp::sendmessage token option... This command sends the MIME part (see package mime) represented by token to an SMTP server. options is a list of options and their associated values. The recognized options are: -servers A list of SMTP servers. The default is localhost. -ports A list of SMTP ports. The default is 25. -client The name to use as our hostname when connecting to the server. By default this is either localhost if one of the servers is localhost, or is set to the string returned by info hostname. -queue Indicates that the SMTP server should be asked to queue the message for later processing. A boolean value. -atleastone Indicates that the SMTP server must find at least one recipient acceptable for the message to be sent. A boolean value. -originator A string containing an 822-style address specification. If present the header isn't examined for an originator address. -recipients A string containing one or more 822-style address specifications. If present the header isn't examined for recipient addresses). If the string contains more than one address they will be separated by commas. -header A list containing two elements, an smtp header and its associated value (the -header option may occur zero or more times). -usetls This package supports the RFC 3207 TLS extension (3) by default provided the tls package is available. You can turn this off with this boolean option. -tlspolicy This option lets you specify a command to be called if an error occurs during TLS setup. The command is called with the SMTP code and diagnostic message appended. The command should return 'secure' or 'insecure' where insecure will cause the package to continue on the unencrypted channel. Returning 'secure' will cause the socket to be closed and the next server in the -servers list to be tried. -username -password If your SMTP server requires authentication (RFC 2554 (4)) before accepting mail you can use -username and -password to pro- vide your authentication details to the server. Currently this package supports DIGEST-MD5, CRAM-MD5, LOGIN and PLAIN authen- tication methods. The most secure method will be tried first and each method tried in turn until we are either authorized or we run out of methods. Note that if the server permits a TLS connection, then the authorization will occur after we begin using the secure channel. If the -originator option is not present, the originator address is taken from From (or Resent-From); similarly, if the -recipients option is not present, recipient addresses are taken from To, cc, and Bcc (or Resent-To, and so on). Note that the header key/values supplied by the -header option (not those present in the MIME part) are consulted. Regardless, header key/values are added to the outgoing message as necessary to ensure that a valid 822-style message is sent. The command returns a list indicating which recipients were unacceptable to the SMTP server. Each element of the list is another list, con- taining the address, an SMTP error code, and a textual diagnostic. Depending on the -atleastone option and the intended recipients, a non- empty list may still indicate that the message was accepted by the server. EXAMPLE
proc send_simple_message {recipient email_server subject body} { package require smtp package require mime set token [mime::initialize -canonical text/plain \ -string $body] mime::setheader $token Subject $subject smtp::sendmessage $token \ -recipients $recipient -servers $email_server mime::finalize $token } send_simple_message someone@somewhere.com localhost \ "This is the subject." "This is the message." REFERENCES
[1] Jonathan B. Postel, "SIMPLE MAIL TRANSFER PROTOCOL", RFC 821, August 1982. (http://www.rfc-editor.org/rfc/rfc821.txt) [2] J. Klensin, "Simple Mail Transfer Protocol", RFC 2821, April 2001. (http://www.rfc-editor.org/rfc/rfc2821.txt) [3] P. Hoffman, "SMTP Service Extension for Secure SMTP over Transport Layer Security", RFC 3207, February 2002. (http://www.rfc-edi- tor.org/rfc/rfc3207.txt) [4] J. Myers, "SMTP Service Extension for Authentication", RFC 2554, March 1999. (http://www.rfc-editor.org/rfc/rfc2554.txt) BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category smtp of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
ftp, http, mime, pop3 KEYWORDS
email, internet, mail, mime, net, rfc 2554, rfc 2821, rfc 3207, rfc 821, rfc 822, smtp, tls CATEGORY
Networking COPYRIGHT
Copyright (c) 1999-2000 Marshall T. Rose and others mime 1.4.5 smtp(n)
All times are GMT -4. The time now is 12:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy