in reply to How to send email using Email::MIME & Email::Sender::Simple?

Your code looks pretty much like what the documentation of Email::Sender says to do. I am confused however about the line my $mime_entity = $message->cast('Email::MIME');, where did you get that from, and what happens when you remove that line? Also, note how the Email::MIME documentation starts with:

Wait! Before you read this, maybe you just need Email::Stuffer, which is a much easier-to-use tool for building simple email messages that might have attachments or both plain text and HTML.

Update: Also, have you made sure you have the newest versions of all of those modules?

Replies are listed 'Best First'.
Re^2: How to send email using Email::MIME & Email::Sender::Simple?
by Magkumar (Novice) on May 03, 2020 at 14:28 UTC

    I did make sure to do cpanm on all the modules in @INC and it said they're up to date. Please ignore the cast line that you've highlighted, that was added by me to try troubleshooting. The error however doesn't change with/without that line. Thanks for pointing Email::Stuffer, I will have a look.

    However, there's an email notification system already running, which is configured same way as in the sample provided. The monk who coded that has left the firm and so I'm learning perl. Not really sure if I will have time rewire the system with Stuffer. Let me see.

    Thanks!