Rob Dixon wrote:
jeevs wrote:
I want to send an email from my windows machine how can I do that with
the following code which throws an error
can't call method mail from an undefined value.

I guess it is the host name that I am providing is wrong ... Where can
I get the SMTP server.

######################

#!c:/perl/bin/perl.exe -w
use strict;
use warnings;
use Net::SMTP;

    my  $smtp = Net::SMTP->new('https://herald.cybage.com/exchange');
    $smtp->mail('[EMAIL PROTECTED]');
    $smtp->to('[EMAIL PROTECTED]');
    $smtp->data();
    $smtp->datasend('To: [EMAIL PROTECTED]');
    $smtp->datasend('From: [EMAIL PROTECTED]');
    $smtp->datasend("\n");
    $smtp->datasend("A simple test message\n");
    $smtp->dataend();
    $smtp->quit;

$####################

Yes, you have used a complete HTTPS URL when just a server name or
address is required. Your provider will give you details of their SMTP
server, but it is likely to be something like 'smtp.cybage.com'. It's
also likely that you have to provide a username and password to use it.

It looks like it is mail.cybage.com:

$ host cybage.com
cybage.com has address 216.92.208.79
cybage.com mail is handled by 10 cybage.com.s7a1.psmtp.com.
cybage.com mail is handled by 25 cybage.com.s7a2.psmtp.com.
cybage.com mail is handled by 50 cybage.com.s7b1.psmtp.com.
cybage.com mail is handled by 75 cybage.com.s7b2.psmtp.com.
$ host mail.cybage.com
mail.cybage.com is an alias for cybage.com.
cybage.com has address 216.92.208.79
cybage.com mail is handled by 75 cybage.com.s7b2.psmtp.com.
cybage.com mail is handled by 10 cybage.com.s7a1.psmtp.com.
cybage.com mail is handled by 25 cybage.com.s7a2.psmtp.com.
cybage.com mail is handled by 50 cybage.com.s7b1.psmtp.com.

It also looks like they have a lot of ports open:

$ nmap cybage.com

Starting Nmap 4.20 ( http://insecure.org ) at 2008-02-06 05:09 PST
Interesting ports on cybage.com (216.92.208.79):
Not shown: 1670 closed ports
PORT      STATE    SERVICE
21/tcp    open     ftp
22/tcp    open     ssh
25/tcp    filtered smtp
26/tcp    open     unknown
80/tcp    open     http
110/tcp   open     pop3
113/tcp   open     auth
135/tcp   filtered msrpc
136/tcp   filtered profile
137/tcp   filtered netbios-ns
138/tcp   filtered netbios-dgm
139/tcp   filtered netbios-ssn
143/tcp   open     imap
144/tcp   open     news
161/tcp   filtered snmp
179/tcp   filtered bgp
306/tcp   open     unknown
445/tcp   filtered microsoft-ds
543/tcp   open     klogin
544/tcp   open     kshell
993/tcp   open     imaps
995/tcp   open     pop3s
6667/tcp  filtered irc
7000/tcp  filtered afs3-fileserver
7001/tcp  filtered afs3-callback
7007/tcp  filtered afs3-bos
31337/tcp filtered Elite

Nmap finished: 1 IP address (1 host up) scanned in 30.366 seconds

Judging by port 31337 it looks like the server is p0wn3d.  Ouch!!  :(



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to