Ishida Tech Solutions, Ltd.
The personal and professional home of Brad Ishida

Set Return-Path with Perl Mail::Mailer - June 26, 2009

If you want to set the Return-Path value in your mail header in a message sent using the Mail Mailer Perl module, here is one way to do it:

Declare your mailer object with the -t and -ba flags.

#!/usr/bin/perl

use Mail::Mailer;

my $mailer = Mail::Mailer->new(’sendmail’, (’-t’,'-ba’));

The Return-Path value will become the address you specify in your “From” line.

Filed under: Learn by Doing — admin @ 12:04 pm
© Copyright 2008-2010 Brad Ishida