【问题标题】:Email from Perl , Cannot locate object method Create来自 Perl 的电子邮件,找不到对象方法创建
【发布时间】:2014-12-09 05:20:25
【问题描述】:

我正在尝试编写一个脚本,该脚本将使用 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      => '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 Module 和 Gmail Modules 时导致此错误的原因。

【问题讨论】:

    标签: perl


    【解决方案1】:

    您缺少 use Email::Simple;perldoc suggests

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-06
      • 1970-01-01
      • 2013-10-04
      • 2010-09-21
      • 1970-01-01
      • 2020-10-15
      • 1970-01-01
      • 2017-11-19
      相关资源
      最近更新 更多