[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] perl script-generated sendmail headers



----- Original Message -----
From: "Olaf Alders" <olaf@xxxxxxxxxxxxxxx>
To: <cobalt-users@xxxxxxxxxxxxxxx>
Sent: Sunday, May 26, 2002 5:14 PM
Subject: Re: [cobalt-users] perl script-generated sendmail headers


> 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(
>
> >From    =>'My Name<info@xxxxxxxxxxxx>',
> To      =>"Someone Else<someone\@somedomain.com>",
> Subject =>'The information you requested',
> Data    =>"Your message goes here",
> );
>
> $msg->send('smtp', "mydomain.com", Timeout=>60);
>
>
>
> ## End of script
>
> Try this out and check your headers.  :-)  Try "man MIME::Lite" at the
> command line for more info, or check the man page at CPAN (cpan.org).
>
>
> --
> Olaf Alders
>
> olaf@xxxxxxxxxxxxxxx
> http://vilerichard.com
>
> Wed, June 5th -- Vile Richard @ Reverb (Queen and Bathurst, Toronto)

Thanks again, Olaf. I guess I need to move this thread to a perl board.
I tried your (much appreciated) smtp snippet, but it made no difference.
The resulting email header still had "Received: from httpd@localhost".

Regards,

:D
--
David Black
Web Developer
www.theWaveCave.com
www.SSL7.com/safemail