How can I disguise the sender's email address with MIME::Lite?sub sendmail { my $server = 'emailserver.com'; my $from = 'myemail@emailserver.com'; my $disguise = 'mygmail@gmail.com'; my $to = $_[0]; my $subject = $_[1]; my $body = $_[2]; use MIME::Lite; my $msg; $msg = MIME::Lite -> new( From => $from, To => $to, CC => $from, Subject => $subject, Type => 'text/html', Data => qq{$body} ); if(not $msg ->send('smtp', $server, Timeout => 60, Debug => 1)){ die "Can not send the message.\n"; } }
I am trying to let the email recipient see my mygmail@gmail.com as the sender' address instead of the myemail@emailserver.com who sends the email. I have to use myemail@emailserver.com in the "From" because the emailserver.com requires the sender's email must be in the server's private list.
I know I can disguise it using Net::SMTP easily, but Net::SMTP does not support html email as far as I know.
Disclaimer: I'm not trying to spam anybody using email. I just need to use this function so that recipient can reply to the right email address.
Any help will be appreciated!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |