Clear questions and runnable code
get the best and fastest answer
Simple forward of email with minor modsby tel2 (Scribe)
|on Jun 19, 2010 at 06:52 UTC||Need Help??|
tel2 has asked for the
wisdom of the Perl Monks concerning the following question:
I've done a search here re forwarding emails, but none of the 4 threads I looked at helped me sufficiently.
I'm a customer of a webhost which uses cPanel, so I can set up an email address which pipes received emails to a program. I'd like to write a perl program to read the email (that works), make some slight changes (I'll handle that later), and forward it to another address (that's where I'm stuck).
So, here's my code so far:
Complex, ain't it?
I've sent email before with MIME::Lite, but that's where I have the body in a separate variable. In this case however, I have the entire email (headers and all) in my variable.
I need to be able to forward any attachments which are in the email.
Also, if possible, I'd like to retain the original sender as the "from" address, but this is not a vital.
What can y'all recommend, to get this working?