Christopher Benson wrote:



I'm wondering if there is a way where you can show the person's REAL name rather than just an email ID when sending an email from Perl. So here's a snip of what I have now...

my $from_addr = "[EMAIL PROTECTED]";

 open (MAIL, "|/usr/lib/sendmail -t");
    print MAIL "To: $to_addr\n",
                "From: $from_addr\n",
              "Cc: $cc\n",
               "Subject: $email_subj$client_name\n\n";
    print MAIL "$email_body";
    close (MAIL);



This is the reason why handling mail directly is generally considered a bad idea, there is just too much to learn and too little time. You would be better served using a module, having said that... often the best way to try and figure out e-mail handling is to look directly at the headers of a message that you would like to emulate... in this case, something like the following should provide what you want...


my $from = 'Joe User <[EMAIL PROTECTED]>';


So doing it this way when the recipients get the email it will say just "[EMAIL PROTECTED]" in the From field in their email client. Is there a way to have it show "Joe User" in the From on their client then when they hit reply it would go to the right person that sent it? Would adding in a "Reply-To" field work? Something like this..



You can add a Reply-to but using it in this manner wouldn't be considered correct form.......


Consider using one of the very excellent modules available on CPAN for mail processing.

http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to