tags:

views:

59

answers:

1

I have read about Email::Stuff and came across some of the example on the net. All the examples then haven't created the object. They straight go away like this:

Email::Stuff->to('Simon Cozens<[email protected]>')
            ->from('[email protected]')
            ->text_body("You've been a good boy this year. No coal for you.")
            ->attach_file('choochoo.gif')
            ->send;

When I follow the above method I get the error Can't locate object method "to" via package "Email::Stuff" (perhaps you forgot to load "Email::Stuff"?) at ./test.pl line 27. Can anyone give examples how to use Email::Stuff?

+3  A: 

As with all Perl modules, you have to use them.

use Email::Stuff;
David Dorward
I had the statement in the code.I forgot to mention that.
karthi_ms
Then it should work (and does for me).
David Dorward
Do you have the module installed?
Geo
That would error with *Can't locate Email/Stuff.pm in @INC* rather than *Can't locate object method*.
David Dorward