I'm using Cygwin's perl, 5.1.0. I'm trying to send email through gmail with perl. The module that I'm trying to use is Email::Send::Gmail. When I type cpan -i Email::Send::Gmail at my cygwin prompt, it looks like it installs, this is what I get:
$cpan -i Email::Send::Gmail CPAN: File::HomeDir loaded ok (v0.80) CPAN: Storable loaded ok (v2.18) Going to read /home/Josh/.cpan/Metadata Database was generated on Sat, 15 Nov 2008 23:26:55 GMT CPAN: YAML loaded ok (v0.66) Going to read /home/Josh/.cpan/build/ ...................................................................... +......DONE Found 52 old builds, restored the state of 52 Running install for module 'Email::Send::Gmail' Running make for L/LB/LBROCARD/Email-Send-Gmail-0.33.tar.gz Has already been unwrapped into directory /home/Josh/.cpan/build/Ema +il-Send-Gm + ail-0.33-tu +JNXE Has already been made Running make test /usr/bin/perl5.10.0.exe "-MExtUtils::Command::MM" "-e" "test_harness(0 +, 'blib/li + b', 'blib/a +rch')" t/*.t t/pod......ok All tests successful. Files=1, Tests=1, 1 wallclock secs ( 0.00 usr 0.00 sys + 0.22 cusr + 0.06 csys + = 0.28 CP +U) Result: PASS LBROCARD/Email-Send-Gmail-0.33.tar.gz /usr/bin/make test -- OK Running make install Prepending /home/Josh/.cpan/build/Email-Send-Gmail-0.33-tuJNXE/blib/ar +ch /home/J + osh/.cpan/b +uild/Email-Send-Gmail-0.33-tuJNXE/blib/lib to PERL5LIB for 'install' Installing /usr/lib/perl5/site_perl/5.10/Email/Send/Gmail.pm Writing /usr/lib/perl5/site_perl/5.10/i686-cygwin/auto/Email/Send/Gmai +l/.packlis Appending installation info to /usr/lib/perl5/5.10/i686-cygwin/perlloc +al.pod LBROCARD/Email-Send-Gmail-0.33.tar.gz /usr/bin/make install -- OK
I then try to run this simple example code:
#!/usr/bin/perl use strict; use warnings; use Email::Send; use Email::Send::Gmail; use Email::Simple::Creator; my $email = Email::Simple->create( header => [ From => 'me@gmail.com', To => 'me@gmail.com', Subject => 'Works!!', ], body => 'w00t', ); my $sender = Email::Send->new( { mailer => 'Gmail', mailer_args => [ username => 'me@gmail.com', password => 'my_password', ] } ); eval { $sender->send($email) }; die "Error sending email: $@" if $@;
But I get this error:
$ ./gmailpop.pl Can't locate Email/Send.pm in @INC (@INC contains: /usr/lib/perl5/5.10 +/i686-cygwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-c +ygwin /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/i +686-cygwin /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/vendor_perl +/5.10 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) +at ./gmailpop.pl line 5. BEGIN failed--compilation aborted at ./gmailpop.pl line 5.
So (perhaps naively) I attempted $ cpan -i Email::Send to which I got
$ cpan -i Email::Send + + CPAN: File: +:HomeDir loaded ok (v0.80) CPAN: Storable loaded ok (v2.18) Going to read /home/Josh/.cpan/Metadata Database was generated on Sat, 15 Nov 2008 23:26:55 GMT CPAN: YAML loaded ok (v0.66) Going to read /home/Josh/.cpan/build/ ...................................................................... +......DONE Found 52 old builds, restored the state of 52 Running install for module 'Email::Send' Running make for R/RJ/RJBS/Email-Send-2.192.tar.gz Has already been unwrapped into directory /home/Josh/.cpan/build/Ema +il-Send-2.192-d4Pxon Has already been made Running make test Has already been tested successfully Running make install Already done
At which point I run out of ideas. Can someone please help me with this? I'm trying to write a very simple script for the holidays, and this is driving me nuts. Thanks!

It should be noted that I don't care what method I used to send emails through gmail, so if there's an alternative to Email::Send::Gmail that might work, by all means suggest it.

In reply to Email::Send::Gmail with Cygwin by JDylan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.