I think I may have seen this one before myself. If I'm right, you'll need
to correctly quote the quotation marks inside your variable which has the
email addresses. You have to get the command to have the quotes if you
print it out to standard output. For example:
$alert_email_address =
"\"foo\@bar.com foo2\@bar.net\ <mailto:foo2\@bar.net\> "";
Essentially, your just escaping the quotes so that if you print
$alert_email_address to standard output you get quotes printed:
<mailto: '[EMAIL PROTECTED] [EMAIL PROTECTED]'> '[EMAIL PROTECTED] [EMAIL PROTECTED]'
and not:
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
-----Original Message-----
From: Mark Sheinbaum [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 17, 2001 8:40 PM
To: 'Mike Rapuano'; 'Brett W. McCoy'
Cc: 'Perl Beginners (E-mail)'
Subject: RE: unix command in a perl script
Don't these require installation on your server? If yes, I'm not authorized
to do that. So, back to my original question... How to enter multiple
destinations when running mailx from a perl script? Thanks again.
Mark
-----Original Message-----
From: Mike Rapuano [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
Sent: Wednesday, October 17, 2001 2:48 PM
To: Brett W. McCoy; Mark Sheinbaum
Cc: Perl Beginners (E-mail)
Subject: RE: unix command in a perl script
Here are some other mail modules I like:
Net::Smtp or Mail::Sender
have fun
Mike
-----Original Message-----
From: Brett W. McCoy
Sent: Wed 10/17/2001 5:40 PM
To: Mark Sheinbaum
Cc: Perl Beginners (E-mail)
Subject: Re: unix command in a perl script
On Wed, 17 Oct 2001, Mark Sheinbaum wrote:
> I want to send email from a pl script using mailx. I'm having
problems
> adding multiple destinations.Only 1 destination is receiving
the email. I
> suspect the problem has to do with the quoting rules. Here's
an example. Any
> help would be much appreciated.
>
> $alert_email_address =
> "foo\@bar.com foo2\@bar.net";
>
> if ($alert_cnt > 0) {
> $subject = "Alerts";
> $file_name = "alert.rpt";
> $result = `mailx -s $subject $alert_email_address <
$file_name`;
> }
There are better ways to accomplish this. Have you looked at
the
Mail::Mailer CPAN module? It'll make your life a little easier.
-- Brett
http://www.chapelperilous.net/ <http://www.chapelperilous.net/>
------------------------------------------------------------------------
Did you know the University of Iowa closed down after someone
stole the book?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]