use strict;
use Crypt::SSLeay;
use HTTP::Cookies;
use HTTP::Headers;
use HTTP::Request::Common;
use LWP::UserAgent;
use Mail::Webmail::Gmail;
my ( $gmail ) = Mail::Webmail::Gmail->new(username => 'my_username', p
+assword => 'my_password' );
### Test Sending Message ####
my $msgid = $gmail->send_message( to => 'drblove@yahoo.com', subject =
+> time(), msgbody => 'Test' ); print "Msgid: $msgid\n";
if ( $msgid ) {
if ( $gmail->error() ) {
print $gmail->error_msg();
} else {
### Create new label ###
my $test_label = "tl_" . time();
$gmail->edit_labels( label => $test_label, action => 'create'
+);
if ( $gmail->error() ) {
print $gmail->error_msg();
} else {
### Add this label to our new message ###
$gmail->edit_labels( label => $test_label, action => 'add'
+, 'msgid' => $msgid );
if ( $gmail->error() ) {
print $gmail->error_msg();
} else {
print "Added label: $test_label to message $msgid\n";
}
}
}
}
I get the following error:
Use of uninitialized value $host in concatenation (.) or string at C:/
+Perl/lib/LWP/Protocol/http.pm line 25.
Use of uninitialized value $page in pattern match (m//) at C:/Perl/sit
+e/lib/Mail/Webmail/Gmail.pm line 1425.
Msgid:
Use of uninitialized value $msgid in concatenation (.) or string at E:
+\Bioreka\gmail\test.pl line 12.
|