什么是如何使用Email :: Stuff的示例?

时间:2010-07-17 06:30:56

标签: perl email

我已经阅读了Email::Stuff,并在网上看到了一些示例。然后所有示例都没有创建对象。他们就这样直接离开了:

Email::Stuff->to('Simon Cozens<simon@somewhere.jp>')
            ->from('Santa@northpole.org')
            ->text_body("You've been a good boy this year. No coal for you.")
            ->attach_file('choochoo.gif')
            ->send;

当我按照上述方法时,我收到错误Can't locate object method "to" via package "Email::Stuff" (perhaps you forgot to load "Email::Stuff"?) at ./test.pl line 27.任何人都可以举例说明如何使用Email :: Stuff?

1 个答案:

答案 0 :(得分:3)

与所有Perl模块一样,您必须use

use Email::Stuff;