来自Perl的电子邮件,找不到对象方法Create
我正在尝试编写一个脚本,它将使用Perl从服务器发送Gmail。代码如图所示来自Perl的电子邮件,找不到对象方法Create,perl,Perl,我正在尝试编写一个脚本,它将使用Perl从服务器发送Gmail。代码如图所示 use warnings; use strict; use Email::Sender; use Email::Send::Gmail; use Email::Simple::Creator; my $email = Email::Simple->create ( header => [ From => 'xxxx@gmail.com', To => 'yy
use warnings;
use strict;
use Email::Sender;
use Email::Send::Gmail;
use Email::Simple::Creator;
my $email = Email::Simple->create (
header => [
From => 'xxxx@gmail.com',
To => 'yyyyy@gmail.com',
Subject => 'Oh no! The bathwater is overflowing!',
],
body => 'The bath water is overflowing.',
);
my $sender = Email::Send->new ({
mailer => 'Gmail',
mailer_args => [
username => 'xxxxx',
password => 'yyyyy',
]
});
$sender->send ($email);
For which I get the error `Can't locate object method "create" via package "Email::Simple" at file.pl line 9.`
当我安装了Email::Simple模块和Gmail模块时,是什么导致了这个错误。您缺少
使用Email::Simple代码>作为。您缺少使用电子邮件::简单代码>作为