Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messagejis 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
Post Follow-up to this messageHi 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.
Post Follow-up to this messageOn Aug 18, 4:30 pm, Michael Zedeler <mich...@zedeler.dk> wrote:
> Hi jis.
>
> jis wrote:
>
>
>
> 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
Post Follow-up to this messagejis 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...#AUTHENTICATION -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl
Post Follow-up to this messageOn Aug 19, 7:43 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote: > jis wrote: > > Either use a mail server that does not need authentication (the server > of your Internet access provider, perhaps?), or provide the requested > login info. > > > Mail::Sender has a method for finding out which protocols are supported > by a particular server. > > http://search.cpan.org/perldoc?Mail...#AUTHENTICATION > > -- > Gunnar Hjalmarsson > Email:http://www.gunnar.cc/cgi-bin/contact.pl Hi, I tried a openmail server in the link [url]http://www.theorem.com/spam/openservers.htm[ /url] 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
Post Follow-up to this messagejis wrote: > On Aug 19, 7:43 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote: > I tried a openmail server in the link http://www.theorem.com/spam/openservers.ht m > > 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
Post Follow-up to this messageOn Aug 19, 11:21 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote: > jis wrote: > > > Good news, then it's no longer open relay. > > > > 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
Post Follow-up to this messageIn article <1187631539.823866.92930@r29g2000hsg.googlegroups.com>, jis <jismagic@gmail.com> 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 mcse.ms Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ---------------------------------------------------------- http://www.mcse.ms
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.