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

Update on my question:

I have removed the below line from the code, that was added by me to troubleshoot the error.

my $mime_entity = $message->cast('Email::MIME');

No change in error with/ without above line in code. I'm using Strawberry Perl 5.20.3