##this section looks up the DNS host name of a given IP address use Socket; $gothostbyaddr=gethostbyaddr($address, 2); ##this section forms and email and sends use OLE; $Mailer = CreateObject OLE 'SMTPsvg.Mailer'; $Mailer->{'FromName'} = 'whatevername'; $Mailer->{'FromAddress'} = 'whatever@mysite.com'; $Mailer->{'RemoteHost'} = 'websmtp.mysite.com'; $Mailer->AddRecipient('Recipient', 'receipient@yoursite.com'); $Mailer->{'Subject'} = "Title page"; $Mailer->{'BodyText'} = "$address is $gothostbyaddr"; if ($Mailer->SendMail()) { print "Mail successfully sent", "\n"; } else { print $Mailer->{'Response'},"Mail failure. Check mail host server +name and tcp/ip connection...", "\n"; }
Now, the DNS lookup script works fine by itself without the email script, and the email script works fine by itself without the DNS script, but when they're together like above, only the DNS lookup script works, and the mail section returns the "10057 Socket is not connected" error msg.
I suspect that the DNS lookup script using socket to check DNS interferes with the script's ability to access the mail server. My webhosting service is a small company and they don't know PERL.
Anyone has a clue?
In reply to [10057] socket is not connected error msg by pegasusFlight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |