Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Mail::Sender problem
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


Report this thread to moderator Post Follow-up to this message
Old Post
jis
08-18-07 12:01 AM


Re: Mail::Sender problem
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

Report this thread to moderator Post Follow-up to this message
Old Post
Gunnar Hjalmarsson
08-18-07 02:59 AM


Re: Mail::Sender problem
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.

Report this thread to moderator Post Follow-up to this message
Old Post
Michael Zedeler
08-18-07 11:59 PM


Re: Mail::Sender problem
On 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


Report this thread to moderator Post Follow-up to this message
Old Post
jis
08-19-07 11:59 PM


Re: Mail::Sender problem
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...#AUTHENTICATION

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Report this thread to moderator Post Follow-up to this message
Old Post
Gunnar Hjalmarsson
08-20-07 03:01 AM


Re: Mail::Sender problem
On 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



Report this thread to moderator Post Follow-up to this message
Old Post
jis
08-20-07 09:01 AM


Re: Mail::Sender problem
jis 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

Report this thread to moderator Post Follow-up to this message
Old Post
Gunnar Hjalmarsson
08-20-07 09:01 AM


Re: Mail::Sender problem
On 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


Report this thread to moderator Post Follow-up to this message
Old Post
jis
08-20-07 11:59 PM


Re: Mail::Sender problem
In 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

Report this thread to moderator Post Follow-up to this message
Old Post
Jim Gibson
08-20-07 11:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Modules archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:08 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.