I've been searching for a week on the internet and read a ton of articles and forum posts, but I haven't been able to find a solution.
I have a few scripts and web pages that send automated emails when certain events occur on orders in our system. The emails appear to come from the rep who owns the order in our company.
It works fine unless there is a bad email address on the order. I would like the bounced emails to go directly to the order rep, but they don't.
My configuration is a Linux server running sendmail and I'm using MIME::Lite to send the messages from Perl scripts.
I use the same code to send the email for both CGI pages and Perl scripts. The emails coming from CGI pages contain the folling in the message header:
From: order.rep@company.com
Reply-To: order.rep@company.com
Return-Path: webserver@script.server.com
Perl scripts run from CRON get a return path of:
Return-Path: root@script.server.com
Is there a sendmail setting that is overriding the MIME::Lite setting? Is there something I'm doing wrong? The Reply-To setting from MIME::Lite works. I'm stumped.
_________
Rott Paws
...It's not a bug. It's an undocumented feature!!!
I have a few scripts and web pages that send automated emails when certain events occur on orders in our system. The emails appear to come from the rep who owns the order in our company.
It works fine unless there is a bad email address on the order. I would like the bounced emails to go directly to the order rep, but they don't.
My configuration is a Linux server running sendmail and I'm using MIME::Lite to send the messages from Perl scripts.
Code:
$msg = MIME::Lite->new(
From => $From,
To => $To,
Cc => $CC,
Subject => $Sub,
Type => 'multipart/mixed');
#Set Reply-To
$msg->add("Return-Path", "$From");
$msg->add("Reply-To", "$From");
#Attach Body of the email
$msg->attach(
Type => $BodyType,
Data => $Body);
#Add Attachment, if any
unless($AttFN eq ""){
$msg->attach(
Type => '',
Path =>$AttPath,
Filename=>$AttFN);
} #end of attachment add
#Send the email
$msg->send;
I use the same code to send the email for both CGI pages and Perl scripts. The emails coming from CGI pages contain the folling in the message header:
From: order.rep@company.com
Reply-To: order.rep@company.com
Return-Path: webserver@script.server.com
Perl scripts run from CRON get a return path of:
Return-Path: root@script.server.com
Is there a sendmail setting that is overriding the MIME::Lite setting? Is there something I'm doing wrong? The Reply-To setting from MIME::Lite works. I'm stumped.
_________
Rott Paws
...It's not a bug. It's an undocumented feature!!!