From: ++imanshu on
Hi,

I am trying the example script of Mail::Sendmail with ActivePerl
on windows pc connected to the internet:-

---
- trying localhost
- connect to localhost failed (Unknown error)
retrying in 1 seconds...
- connect to localhost failed, next server...
connect to localhost failed (Unknown error)
connect to localhost failed
connect to localhost failed (Unknown error) no (more) retries!
---

This is the script :-

use Mail::Sendmail;

%mail = ( To => 'random.random(a)gmail.com',
From => 'random(a)yahoo.com',
Message => "This is a very short message",
);

sendmail(%mail) or die $Mail::Sendmail::error;

print "OK. Log says:\n", $Mail::Sendmail::log;

---

What can I set $mail{smtp} so that it works?

Thank You,
++imanshu


From: smallpond on
On Nov 8, 6:39 am, "++imanshu" <himanshu.g...(a)gmail.com> wrote:
> Hi,
>
>      I am trying the example script of Mail::Sendmail with ActivePerl
> on windows pc connected to the internet:-
>
> ---
> - trying localhost
> - connect to localhost failed (Unknown error)
> retrying in 1 seconds...
> - connect to localhost failed, next server...
> connect to localhost failed (Unknown error)
> connect to localhost failed
> connect to localhost failed (Unknown error) no (more) retries!
> ---
>
>      This is the script :-
>
>   use Mail::Sendmail;
>
>   %mail = ( To      => 'random.ran...(a)gmail.com',
>             From    => 'ran...(a)yahoo.com',
>             Message => "This is a very short message",
>           );
>
>   sendmail(%mail) or die $Mail::Sendmail::error;
>
>   print "OK. Log says:\n", $Mail::Sendmail::log;
>
> ---
>
>      What can I set $mail{smtp} so that it works?
>
> Thank You,
> ++imanshu


Installation instructions for Mail::Sendmail:

"At the top of Sendmail.pm, set your default SMTP server(s),
unless you specify it with each message, or want to use the
default (localhost)."

Default is that you are running an smtp mail program listening
on your machine's smtp port. If you don't know what that is
then you don't have one.

Otherwise you need to have a server somewhere else that
supports smtp. Usually, your isp will provide an smtp
server like mail.myisp.net; see their support website.
Some cheap isps now only provide web-based email, in which
case you tell them to go get a new customer.

From: Bart Lateur on
++imanshu wrote:

>Hi,
>
> I am trying the example script of Mail::Sendmail with ActivePerl
>on windows pc connected to the internet:-

I think this module expects sendmail to be running on your computer, or
on a computer in your local network, and with Windows, that's not very
likely.

Why aren't you using SMTP?

If you use MIME::Lite, you can easily switch between the two, which is
handy even if your mails aren't MIME mails.

--
Bart.
From: ++imanshu on
On Nov 8, 11:03 pm, smallpond <smallp...(a)juno.com> wrote:
> On Nov 8, 6:39 am, "++imanshu" <himanshu.g...(a)gmail.com> wrote:
>
>
>
> > Hi,
>
> >      I am trying the example script of Mail::Sendmail with ActivePerl
> > on windows pc connected to the internet:-
>
> > ---
> > - trying localhost
> > - connect to localhost failed (Unknown error)
> > retrying in 1 seconds...
> > - connect to localhost failed, next server...
> > connect to localhost failed (Unknown error)
> > connect to localhost failed
> > connect to localhost failed (Unknown error) no (more) retries!
> > ---
>
> >      This is the script :-
>
> >   use Mail::Sendmail;
>
> >   %mail = ( To      => 'random.ran...(a)gmail.com',
> >             From    => 'ran...(a)yahoo.com',
> >             Message => "This is a very short message",
> >           );
>
> >   sendmail(%mail) or die $Mail::Sendmail::error;
>
> >   print "OK. Log says:\n", $Mail::Sendmail::log;
>
> > ---
>
> >      What can I set $mail{smtp} so that it works?
>
> > Thank You,
> > ++imanshu
>
> Installation instructions for Mail::Sendmail:
>
> "At the top of Sendmail.pm, set your default SMTP server(s),
> unless you specify it with each message, or want to use the
> default (localhost)."

yes I wrongly assumed smtp to be so simple that the module alone could
handle it without another server. There were some EHLO, HELO strings
in the pm file which reinforced my wrong assumption.

>
> Default is that you are running an smtp mail program listening
> on your machine's smtp port.  If you don't know what that is
> then you don't have one.

now i understand that i do need one.

>
> Otherwise you need to have a server somewhere else that
> supports smtp.  Usually, your isp will provide an smtp
> server like mail.myisp.net; see their support website.
> Some cheap isps now only provide web-based email, in which
> case you tell them to go get a new customer.

My ISP apparently provides relay but under another costlier plan!!

Thank You,
++imanshu
From: Uri Guttman on
>>>>> "+" == ++imanshu <himanshu.garg(a)gmail.com> writes:

>> Otherwise you need to have a server somewhere else that
>> supports smtp. �Usually, your isp will provide an smtp
>> server like mail.myisp.net; see their support website.
>> Some cheap isps now only provide web-based email, in which
>> case you tell them to go get a new customer.

+> My ISP apparently provides relay but under another costlier plan!!

that makes no sense. do they even provide a basic email account? if they
do, they must provide outgoing email service via an smtp
server. relaying is if you need a server on your box and they would
relay it elsewhere (or something similar than typical users would never
need). so find out the name of the outgoing mail server and you can use
it directly with most smtp modules on cpan. you don't need a local
server to send mail if you isp allows you to have a mail account. you
will likely need to provide an account name and password but most of the
modules can handle that too.

uri

--
Uri Guttman ------ uri(a)stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------