On Wed, Mar 08, 2000 at 01:17:26PM +0100, VAHAGN AVEDIAN wrote:
> Hi,
>
> Is there a simple way to set the 'Subject' value when sending an email
> in PERL???
>
> I use the syntax:
>
> $MailAddress = "etxaved\@etxb.ericsson.se";
> $MailFileName = "message.txt";
> `mail $MailAddress < $MailFileName`;
>
> But since the subject is not set the received email gets a blank subject
> field.
>
> Is there a simple solution?
You are not really using perl to send mail here, you are
using perl to invoke shell which invokes program "mail".
One of the perl ways would be, for example, using
Mail::Mailer:
use Mail::Mailer;
$mailer = new Mail::Mailer 'smtp', Server => $your_smtp_server;
$mailer->open ({
Subject => 'learning to send mail',
From => '[EMAIL PROTECTED]',
To => '[EMAIL PROTECTED]'
});
.............
$mailer->close;
--
Ilya Ketris <[EMAIL PROTECTED]>