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 $@;
}