thanks for the help, i changed the smtp.cctv.dundee.ac.uk to the smtp.dundee.ac.uk, and i got results, but does no email sent?
[EMAIL PROTECTED] cgi-bin]# perl emailtest.pl Content-type: text/plain
Net::SMTP: Net::SMTP(2.24) Net::SMTP: Net::Cmd(2.21) Net::SMTP: Exporter(5.566) Net::SMTP: IO::Socket::INET(1.26) Net::SMTP: IO::Socket(1.27) Net::SMTP: IO::Handle(1.21)
Net::SMTP=GLOB(0x81cdf28)<<< 220 mh-gen-a1.dundee.ac.uk Mercury 1.48 ESMTP serve
r ready.
Net::SMTP=GLOB(0x81cdf28)>>> EHLO localhost.localdomain
Net::SMTP=GLOB(0x81cdf28)<<< 250-mh-gen-a1.dundee.ac.uk Hello localhost.localdom
ain; ESMTPs are:
Net::SMTP=GLOB(0x81cdf28)<<< 250-TIME
Net::SMTP=GLOB(0x81cdf28)<<< 250-SIZE 30000000
Net::SMTP=GLOB(0x81cdf28)<<< 250 HELP
Net::SMTP=GLOB(0x81cdf28)>>> MAIL FROM:<[EMAIL PROTECTED]>
Net::SMTP=GLOB(0x81cdf28)<<< 250 Sender OK - send RCPTs.
Net::SMTP=GLOB(0x81cdf28)>>> RCPT TO:<[EMAIL PROTECTED]>
Net::SMTP=GLOB(0x81cdf28)<<< 250 Recipient OK - send RCPT or DATA.
Net::SMTP=GLOB(0x81cdf28)>>> DATA
Net::SMTP=GLOB(0x81cdf28)<<< 354 OK, send data, end with CRLF.CRLF
Net::SMTP=GLOB(0x81cdf28)>>> To: [EMAIL PROTECTED]
Net::SMTP=GLOB(0x81cdf28)>>> From: [EMAIL PROTECTED]
Net::SMTP=GLOB(0x81cdf28)>>> Subject: Test Message
Net::SMTP=GLOB(0x81cdf28)>>>
Net::SMTP=GLOB(0x81cdf28)>>> Hello World!
Net::SMTP=GLOB(0x81cdf28)>>> .
Net::SMTP=GLOB(0x81cdf28)<<< 250 Data received OK.
Net::SMTP=GLOB(0x81cdf28)>>> QUIT
Net::SMTP=GLOB(0x81cdf28)<<< 221 mh-gen-a1.dundee.ac.uk Service closing channel.
[EMAIL PROTECTED] cgi-bin]#
[EMAIL PROTECTED] cgi-bin]#
Regards,
Mel
From: "Dan Muey" <[EMAIL PROTECTED]> To: "mel awaisi" <[EMAIL PROTECTED]> CC: <[EMAIL PROTECTED]> Subject: RE: script to send email message Date: Tue, 25 Mar 2003 15:03:58 -0600
> > Hi Dan
Howdy - Post back to the list so everyone can share.
> > ok, i changed it to > smtp.cctv.dundee.ac.uk > > but still, > [EMAIL PROTECTED] cgi-bin]# perl emailtest.pl > Content-type: text/plain > > Couldn't connect to server at emailtest.pl line 23. > [EMAIL PROTECTED] cgi-bin]# > > does the email from has to be from the server? if so then how
Depends how smtp is set up at smtp.cctv.dundee.ac.uk Does that allow smtp connections from the ip address the script is at?
> do i create > this, i dont have an email server on my server. i basically > installed red > hat 8.
Another thing. It may be dns :: If I do a ping :: # ping smtp.cctv.dundee.ac.uk
ping: cannot resolve smtp.cctv.dundee.ac.uk: Unknown host #
Try the ip address of the server instead of the domain or a resolvable domain at least.
If you specify/can resolve the domain to it's ip and the smtp server will allow smtp connections from your ip address then you're all set.
It's not really a perl issue but an smtp server/dns issue.
Hope that helps
DMuey
> > Regards, > > Mel > > > > > > >From: "Dan Muey" <[EMAIL PROTECTED]> > >To: "mel awaisi" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > >Subject: RE: script to send email message > >Date: Tue, 25 Mar 2003 14:35:51 -0600 > > > > > > > Hi, > > > > > > I have been researching on this. i got a script when i try to run > > > get an error connecting to server. This script i am just trying to > > > get to work, but > > > the main reason for this is to be able to insert it into > > > another Perl script > > > where i would like email to be sent automatically when the > > > other part of the > > > script does something! > > > > > > [EMAIL PROTECTED] cgi-bin]# perl email.pl > > > Content-type: text/plain > > > > > > Couldn't connect to server at email.pl line 22. > > > [EMAIL PROTECTED] cgi-bin]# > > > > > > > > > Regards, > > > > > > Mel > > > > > > ---------------------email.pl > > > > > > #!/usr/local/bin/perl > > > > > > use Net::SMTP; > > > > > > print "Content-type: text/plain", "\n\n"; > > > > > > my $DEBUG = 1; > > > > > > if($DEBUG) > > > { > > > $| = 1; > > > open(STDERR, ">&STDOUT"); > > > } > > > > > > # Set this variable to your smtp server name > > > my $ServerName = "smtp.134.36.16.12"; > > > >Uh, IP address or name can't mix em. I'd make this 134.36.16.12 > >Or > >smtp.whateverthedomainisforthatip.com > > > >I'll bet tha'd clear it right up > > > >DMuey > > > > > > > > # Create a new SMTP object > > > $smtp = Net::SMTP->new($ServerName, Debug => 1); > > > > > > # If you can't connect, don't proceed with the rest of the script > > > die "Couldn't connect to server" unless $smtp; > > > > > > # Initiate the mail transaction > > > # Your "real" email address > > > my $MailFrom = "[EMAIL PROTECTED]"; > > > > > > # Recipient's "real" email address > > > my $MailTo = "[EMAIL PROTECTED]"; > > > > > > $smtp->mail( $MailFrom ); > > > $smtp->to( $MailTo ); > > > > > > # Start the mail > > > $smtp->data(); > > > > > > # Send the header > > > # This address will appear in the message > > > $smtp->datasend("To: [EMAIL PROTECTED]"); > > > > > > # So will this one > > > $smtp->datasend("From: [EMAIL PROTECTED]"); > > > $smtp->datasend("Subject: Test Message\n"); $smtp->datasend("\n"); > > > > > > # Send the body. > > > $smtp->datasend("Hello World!\n\n"); > > > > > > # Send the termination string > > > $smtp->dataend(); > > > > > > # Close the connection > > > $smtp->quit(); > > > > > > > > > _________________________________________________________________ > > > On the move? Get Hotmail on your mobile phone > > > http://www.msn.co.uk/msnmobile/mobilehotmail > > > > > > > > > -- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > >-- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > _________________________________________________________________ > It's fast, it's easy and it's free. Get MSN Messenger today! > http://www.msn.co.uk/messenger > >
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]