Mail::Sender problem
am 17.08.2007 16:20:46 von jis
Hi,
I tried
#!/usr/bin/perl
use Mail::Sender;
$sender = new Mail::Sender
{smtp => 'smtp.gmail.com', from => 'jismagic@gmail.com'};
$sender->MailFile({to => 'jismagic@gmail.com',
subject => 'Here is the file',
msg => "I'm sending you the list you wanted."});
But gave me the error
"Cant call the method mailfile without a package or object reference"
Pls help. I am using WIndows Xp and iam using mail::Sender 0.8.13.
regards,
jis
Re: Mail::Sender problem
am 18.08.2007 03:39:58 von Gunnar Hjalmarsson
jis wrote:
> I tried
>
> #!/usr/bin/perl
> use Mail::Sender;
> $sender = new Mail::Sender
> {smtp => 'smtp.gmail.com', from => 'jismagic@gmail.com'};
>
> $sender->MailFile({to => 'jismagic@gmail.com',
> subject => 'Here is the file',
> msg => "I'm sending you the list you wanted."});
>
> But gave me the error
> "Cant call the method mailfile without a package or object reference"
Can't reproduce that error msg, but I know that the MailFile method
expects a file... Please post your actual code that generated the above
error message.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Re: Mail::Sender problem
am 18.08.2007 23:30:19 von Michael Zedeler
Hi jis.
jis wrote:
> #!/usr/bin/perl
> use Mail::Sender;
> $sender = new Mail::Sender
> {smtp => 'smtp.gmail.com', from => 'jismagic@gmail.com'};
>
> $sender->MailFile({to => 'jismagic@gmail.com',
> subject => 'Here is the file',
> msg => "I'm sending you the list you wanted."});
>
> But gave me the error
> "Cant call the method mailfile without a package or object reference"
That can't be the actual error message, since the method you tried was
MailFile - perl is case sensitive.
If you read the manual, it says that what the constructor (new) will
return in case of problems is an error code. Try printing $sender like
so right after instantiating it:
print "I got this result from new(): $sender\n";
If it is numeric, its an error code. Look it up in the manual.
Also, it seems that MailFile expects a file key in the hash you pass to
it. See the manual for more info.
Regards,
Michael.
Re: Mail::Sender problem
am 19.08.2007 19:26:08 von jis
On Aug 18, 4:30 pm, Michael Zedeler wrote:
> Hi jis.
>
> jis wrote:
> > #!/usr/bin/perl
> > use Mail::Sender;
> > $sender = new Mail::Sender
> > {smtp => 'smtp.gmail.com', from => 'jisma...@gmail.com'};
>
> > $sender->MailFile({to => 'jisma...@gmail.com',
> > subject => 'Here is the file',
> > msg => "I'm sending you the list you wanted."});
>
> > But gave me the error
> > "Cant call the method mailfile without a package or object reference"
>
> That can't be the actual error message, since the method you tried was
> MailFile - perl is case sensitive.
>
> If you read the manual, it says that what the constructor (new) will
> return in case of problems is an error code. Try printing $sender like
> so right after instantiating it:
>
> print "I got this result from new(): $sender\n";
>
> If it is numeric, its an error code. Look it up in the manual.
>
> Also, it seems that MailFile expects a file key in the hash you pass to
> it. See the manual for more info.
>
> Regards,
>
> Michael.
Yes,It was my mistake.
I modified the code like
use strict;
use Mail::Sender;
my $smtp = 'smtp.gmail.com';
my $subj = 'mail sender test';
my $admn = 'j******a@gmail.com';
my $body = 'HOWDY';
my $sender = new Mail::Sender {smtp => $smtp, from => $admn,to =>
$admn, subject => $subj};
$sender->Open({
to => $admn,
subject => $subj,
});
$sender->Close();
if( $Mail::Sender::Error) {
print "Error sending mail: $Mail::Sender::Error \n";
} else { print "Sent ok to $admn $Mail::Sender::Error \n"; }
But
I got the error message "LOGIN not accepted".
I guess it is the authentication protocol that stops me.
But I wonder how I can get over it.This module supports only LOGIN,
PLAIN, CRAM-MD5 and NTLM.I am not sure which shic server uses these
protocols.
Any ideas. All I need is to send email through my script.
Please help.
Cheers,
jishnu
Re: Mail::Sender problem
am 20.08.2007 02:43:02 von Gunnar Hjalmarsson
jis wrote:
> I got the error message "LOGIN not accepted".
> I guess it is the authentication protocol that stops me.
> But I wonder how I can get over it.
Either use a mail server that does not need authentication (the server
of your Internet access provider, perhaps?), or provide the requested
login info.
> This module supports only LOGIN, PLAIN, CRAM-MD5 and NTLM.I am not
> sure which shic server uses these protocols.
Mail::Sender has a method for finding out which protocols are supported
by a particular server.
http://search.cpan.org/perldoc?Mail%3A%3ASender#AUTHENTICATI ON
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Re: Mail::Sender problem
am 20.08.2007 05:25:44 von jis
On Aug 19, 7:43 pm, Gunnar Hjalmarsson wrote:
> jis wrote:
> > I got the error message "LOGIN not accepted".
> > I guess it is the authentication protocol that stops me.
> > But I wonder how I can get over it.
>
> Either use a mail server that does not need authentication (the server
> of your Internet access provider, perhaps?), or provide the requested
> login info.
>
> > This module supports only LOGIN, PLAIN, CRAM-MD5 and NTLM.I am not
> > sure which shic server uses these protocols.
>
> Mail::Sender has a method for finding out which protocols are supported
> by a particular server.
>
> http://search.cpan.org/perldoc?Mail%3A%3ASender#AUTHENTICATI ON
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl
Hi,
I tried a openmail server in the link http://www.theorem.com/spam/openservers.htm
Whnen i tried,it gives me the error authentication required.
As told I checked
my @protocols = $sender->QueryAuthProtocols( $smtp);
print @protocols;
Whatever u give it gives me PLAINXYMCOOKIELOGIN
Please help.
regards,
jis
Re: Mail::Sender problem
am 20.08.2007 06:21:28 von Gunnar Hjalmarsson
jis wrote:
> On Aug 19, 7:43 pm, Gunnar Hjalmarsson wrote:
>> jis wrote:
> I tried a openmail server in the link http://www.theorem.com/spam/openservers.htm
>
> Whnen i tried,it gives me the error authentication required.
Good news, then it's no longer open relay.
> As told I checked
> my @protocols = $sender->QueryAuthProtocols( $smtp);
> print @protocols;
> Whatever u give it gives me PLAINXYMCOOKIELOGIN
>
> Please help.
While this group provides help on using Perl modules, your problem is of
another nature. Please ask your ISP or hosting provider for help on
which smtp server to use and which login information to provide, if
applicable. Come back here when you have a Perl question.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Re: Mail::Sender problem
am 20.08.2007 19:38:59 von jis
On Aug 19, 11:21 pm, Gunnar Hjalmarsson wrote:
> jis wrote:
> > On Aug 19, 7:43 pm, Gunnar Hjalmarsson wrote:
> >> jis wrote:
> > I tried a openmail server in the linkhttp://www.theorem.com/spam/openservers.htm
>
> > Whnen i tried,it gives me the error authentication required.
>
> Good news, then it's no longer open relay.
>
> > As told I checked
> > my @protocols = $sender->QueryAuthProtocols( $smtp);
> > print @protocols;
> > Whatever u give it gives me PLAINXYMCOOKIELOGIN
>
> > Please help.
>
> While this group provides help on using Perl modules, your problem is of
> another nature. Please ask your ISP or hosting provider for help on
> which smtp server to use and which login information to provide, if
> applicable. Come back here when you have a Perl question.
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl
Hi,
I am not sure again this is the right place to ask. Any way I am
putting my question here.
I managed to send email through my script. My issue as stated above
was which smtp server to be used.
Now I have the script in .pl format. I converted this to exe format.
As exe it creates problem. It throws me the error " -3Error Sending
mail: Connect failed:An established connection was aborted by software
in your host machine"
My .pl file works fine.But not the exe made out of .pl on the same
machine.
Any ideas.Pls share.
Xtremely sorry if Im asking in the wrong place.
regards,
jis
Re: Mail::Sender problem
am 20.08.2007 23:08:39 von Jim Gibson
In article <1187631539.823866.92930@r29g2000hsg.googlegroups.com>, jis
wrote:
[original problem solved and snipped]
> Hi,
>
> I am not sure again this is the right place to ask. Any way I am
> putting my question here.
>
> I managed to send email through my script. My issue as stated above
> was which smtp server to be used.
>
> Now I have the script in .pl format. I converted this to exe format.
> As exe it creates problem. It throws me the error " -3Error Sending
> mail: Connect failed:An established connection was aborted by software
> in your host machine"
>
> My .pl file works fine.But not the exe made out of .pl on the same
> machine.
That is a legitimate Perl question, but as the problem may not be due
to a specific module, you might want to re-ask in comp.lang.perl.misc.
If you do, please try to post a short-but-complete program that
demonstrates your problem. You may also want to start a new thread, as
this sounds lika a new problem.
Can you successfully convert and run Perl exe programs that do not use
Mail::Sender? That would be a useful clue as to what is going on.
Please also state the versions of Perl, Mail::Sender and the operating
system you are using.
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com