kleinbiker7 has asked for the wisdom of the Perl Monks concerning the following question:

Hey guys, I need to generate a header like this:
From: IDI Solutions <proactive@client.policy.net>
Here is what I am using:
$proactiveEmail = 'proactive@' . 'robert.policy.net'; $msg = MIME::Lite->new( From =>"\"IDI Solutions\" <$proactiveEmail>", 'Errors-to' => "bounces\@$clientid.policy.net", To =>"$TheAdminsEmail", Precedence => 'special-delivery', #Cc =>'robert@idi.net', Subject =>'Bulk Delete Completed', Type =>'text/plain', Data =>"$message" );
However, I am getting this error:
[Fri Feb 7 10:17:11 2003] bulkchanges-shared: at /xxx/qqq/yyy/zzz/bu +lkchanges-shared line 439 [Fri Feb 7 10:18:29 2003] bulkchanges-shared: SMTP MAIL command faile +d: [Fri Feb 7 10:18:29 2003] bulkchanges-shared: Bad address syntax [Fri Feb 7 10:18:29 2003] bulkchanges-shared: [Fri Feb 7 10:18:29 2003] bulkchanges-shared: at /xxx/qqq/yyy/zzz/bu +lkchanges-shared line 439
What's going on here? How can I get my email headers to work correctly? The problem is in the From: line, but I dont know how to generate multi-word <email> From: headers in MIME::LIte. Thanks!

Replies are listed 'Best First'.
Re: MimeLite Header Problem
by jasonk (Parson) on Feb 07, 2003 at 15:52 UTC

    This looks like your mail server is rejecting that address, if it is just because of the format, you could try a similar format that has the same meaning, according to the RFC the address should be written as:

    From => "IDI Solutions <$proactiveEmail>", or From => "$proactiveEmail (IDI Solutions)",
      THE SECOND ONE WORKED!!!! I THANK YOU JASONK! G-D BLESS YOU!!!