[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] perl script-generated sendmail headers
- Subject: Re: [cobalt-users] perl script-generated sendmail headers
- From: Olaf Alders <olaf@xxxxxxxxxxxxxxx>
- Date: Sun May 26 15:31:04 2002
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
on 5/26/02 4:36 PM, David Black wrote:
>
> Thanks, Olaf... but I've never used SMTP before, so I'm not sure how to
> adapt
> my script to use your syntax suggestion. Here's the sub that I'm using now:
>
> open MAIL, "|/usr/sbin/sendmail -t -i -fuser\@myserver.com";
> print MAIL "To: $to\r\nFrom: $from\nSubject: $subject\n\n$message\n\n";
> close MAIL;
>
> Could you please be more explicit? Thanks again for your valuable time
> and knowledge.
>
I won't get into a big discussion on perl, but I'll push this through before
the list cops get too angry. Keep in mind that MIME::Lite makes it very
easy to send attachments, HTML emails, etc. I used to pipe messages through
sendmail but I like to use MIME::Lite for those scripts now. Makes your
life very easy.
#!/usr/bin/perl
use strict;
use MIME::Lite;
### Create a new message:
my $msg = MIME::Lite->new(