Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Email an Attachment via Gmail

by anujsethi91 (Initiate)
on Apr 05, 2013 at 07:57 UTC ( #1027093=perlquestion: print w/ replies, xml ) Need Help??
anujsethi91 has asked for the wisdom of the Perl Monks concerning the following question:

hi guys, can you please tell me how do i install the module Email::Send::SMTP::Gmail, i've tried with cpan, and ppm install, but its showing "error installing package, don't know what it is, could not locate ppd file!!. Else can you tell me how do i send an attachment via gmail using perl. thanks guys. the code im using is given below, its showing the error "BEGIN failed at line 4"
use strict; use warnings; use Email::Send::SMTP::Gmail; my $mail=Email::Send::SMTP::Gmail->new( -smtp=>'smtp.gmail.com', -login=>'myid', -pass=>'mypasswrd'); $mail->send(-to=>'sendtoid', -subject=>'Hello!', -body=>'Just testing +it', -attachments=>'C:/strawberry/perl/test.txt'); $mail->bye;
guys i used cpan Gmail, and it worked just fine, but now i'm getting a whole new kind of an error, my code is the same as above but now its showing :: 'Can't locate object method "new" via package "Email::Send::SMTP::Gmail" <perhaps you forgot to load "Email::Send::SMTP::Gmail"> at email1.pl line 5' please help

Comment on Email an Attachment via Gmail
Download Code
Re: Email an Attachment via Gmail
by davido (Archbishop) on Apr 05, 2013 at 08:18 UTC

    What version are you trying to install? Version 0.40 seemed to have a zero-percent success rate with the smokers, while 0.43 seems to have 100% success among the smokers that have tested it.

    When you try cpan install Email::Send::SMTP::Gmail, what error messages do you get?

    Update: Just to check, I ran "cpanm Email::Send::SMTP::Gmail", and got a successful installation on the first try. There were a total of five distributions pulled in on my system (the target plus its dependencies).


    Dave

Re: Email an Attachment via Gmail
by prashantktyagi (Scribe) on Apr 05, 2013 at 12:03 UTC
Re: Email an Attachment via Gmail
by hdb (Parson) on Apr 05, 2013 at 12:12 UTC

    Same problem for me. Try

    cpan install Gmail
      thank you it worked perfectly!! but now that its detecting the module, i am stuck at a new problem. my code is the same as above but now its showing :: 'Can't locate object method "new" via package "Email::Send::SMTP::Gmail" <perhaps you forgot to load "Email::Send::SMTP::Gmail"> at email1.pl line 5' please help

        Back to my original question of you: What do you see when you type:

        cpan install Email::Send::SMTP::Gmail

        Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1027093]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (17)
As of 2014-07-10 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (209 votes), past polls