Skip Menu |

This queue is for tickets about the Email-Send-Gmail CPAN distribution.

Report information
The Basics
Id: 48641
Status: open
Priority: 0/
Queue: Email-Send-Gmail

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
rndapology [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug: Cannot use Cc or Bcc headers or multiple emails in To header
Date: Wed, 12 Aug 2009 01:17:29 -0700
To: bug-Email-Send-Gmail [...] rt.cpan.org
From: Michael Phillips <rndapology [...] gmail.com>
Hello, It seems I cannot use the Cc or Bcc headers or multiple emails in the To header when sending emails with Email::Send::Gmail. I have no problems when sending to a single email address and obviously can send via Bcc and Cc from my Gmail account. I am using Perl 5.10.0 and version 0.33 of Email::Send::Gmail. Any help you could provide would be appreciated. There is a Perlmonks thread about this that does not end with enlightenment: http://www.perlmonks.org/?node_id=738662 Information that might help is below: [default@central extra]$ uname -a Linux central 2.6.25.14-108.fc9.x86_64 #1 SMP Mon Aug 4 13:46:35 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux [default@central extra]$ ~/test_email_send.pl Error sending email: Email::Send::Gmail: no valid recipients at /usr/local/lib/perl5/site_perl/5.10.0/Email/Send.pm line 252 at /usr/local/lib/perl5/site_perl/5.10.0/Email/Send.pm line 252 [default@central extra]$ cat ~/test_email_send.pl #! /usr/bin/perl -w use Email::Simple::Creator; use Email::Send; use Email::Send::Gmail; use strict; email_me("test","test"); sub email_me { my $message=shift; my $body=shift; my $email = Email::Simple->create( header => [ From => 'blah@gmail.com', To => 'blah@gmail.com', Cc => 'blahblah@gmail.com', Subject => "$message", ], body => "$body", ); my $sender = Email::Send->new( { mailer => 'Gmail', mailer_args => [ username => 'blah@gmail.com', password => 'blah', ] } ); eval { $sender->send($email) }; die "Error sending email: $@" if $@; }
Just had a friend hit this bug. It appears to me the problem is the following code: if ( @to != @ok ) { my %to; @to{@to} = (1) x @to; delete @to{@ok}; @bad = keys %to; } croak("Email::Send::Gmail: no valid recipients") if @bad == @to; I'm not a genius and don't understand what this code is trying to achieve, but it looks for all the world like its comparing 2 lists in scalar context ( that is, comparing 2 numbers .... ) and given the context and the names of the variables, this seems like an error. My friend they experienced satisfaction by simply commenting the whole line with "croak" on it in the above snippet. Hope this proves useful.