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

Hey Fellows I have this line in my code to sending e-mail through sendmail: print MAIL "To: Mr Boo <mrboo\@a.com>\n"; It sends e-mail ok BUT when i get the e-mail it does not appear like: To: Mr Boo <mrboo@a.com> In other words the name doesnt appear, anybody know how i can do it so the Mr Boo like that on the e-mails? Tnx!!

Replies are listed 'Best First'.
Re: Sending mail through sendmail
by Aighearach (Initiate) on Dec 23, 2001 at 02:10 UTC
Re: Sending mail through sendmail
by dvergin (Monsignor) on Dec 23, 2001 at 04:43 UTC
    Put the name in paren's. This works with sendmail:    print MAIL "To: (Joe Doe) jdoe\@server.com"; For all I know, there may be other ways to do it as well (.e.g. <Joe Doe>, etc.)
Re: Sending mail through sendmail
by Chrisf (Friar) on Dec 23, 2001 at 02:11 UTC
    As far as I know you can't set the name directly through the script (I could be wrong). However, you can set it through sendmail's virtual user table.

    You can find more information on the virtual user table here (sendmail.org)