sendmail and MIME

I’m trying a script that sends out multipart (HTML) e-mail but sendmail is
stripping out the headers that the script puts in the message (e.g.
Content-Type). Is there a flag I can use in calling sendmail that will preserve
the headers?

Re: sendmail and MIME

“Winston D. Neutel” wrote:
>
> I’m trying a script that sends out multipart (HTML) e-mail but sendmail is
> stripping out the headers that the script puts in the message (e.g.
> Content-Type). Is there a flag I can use in calling sendmail that will
> preserve the headers?

Using MIME::Lite should make things easy.


Peter N. Go - mailto:peter@icthus.net

http://CGI-City.net http://BannerBuild.com http://BudgetWebHost.com
http://NewsCuts.com http://RegisterGuy.com http://WebPluck.com

        Earn Higher Commissions by Offering High-Margin Products
          <a href="http://quinst.com/c.jsp?area=inheichinherterselausen">http://quinst.com/c.jsp?area=inheichinherterselausen</a>

Re: sendmail and MIME

Peter N. Go <peter@icthus.net> wrote in message
news:3AC7097B.9208DE5C@icthus.net
> Using MIME::Lite should make things easy.

Thought of that. Only MIME::Base64 and MIME::QuotedPrint are avaliable on wwsi,
it seems. And neither of those actually send the mail themselves.

In any case, there are other perl modules on wwsi which send mail, but the
headers they set are not preserved. I tested that the perl stuff was working
by redirecting output to a file, and the headers were there. But if they mail
the output (or if I use ‘cat’ to pipe that file to sendmail myself), the
headers are gone.

Re: sendmail and MIME

“Winston D. Neutel” wrote:
>
> Thought of that. Only MIME::Base64 and MIME::QuotedPrint are avaliable on
> wwsi, it seems. And neither of those actually send the mail themselves.

AFAIK, Lite.pm can be placed into a directory of your choice and be referred to
by the “require” statement. Example:

require ‘/path/to/your/Lite.pm’;

OR

Request JD to install Lite.pm :slight_smile:


Peter N. Go - mailto:peter@icthus.net

http://CGI-City.net http://BannerBuild.com http://BudgetWebHost.com
http://NewsCuts.com http://RegisterGuy.com http://WebPluck.com

        Earn Higher Commissions by Offering High-Margin Products
          <a href="http://quinst.com/c.jsp?area=inheichinherterselausen">http://quinst.com/c.jsp?area=inheichinherterselausen</a>

Re: sendmail and MIME

“Peter N. Go” wrote:
>
> AFAIK, Lite.pm can be placed into a directory of your choice and be referred
> to by the “require” statement. Example:
>
> require ‘/path/to/your/Lite.pm’;

Yes, perl will search ALL the paths in @INC to find the module it’s looking for.
So simply place the module in a subdir of where the script is, and make sure
that the cwd is in the @INC.

-Mike K.

Re: sendmail and MIME

Done deal - MIME::Lite 2.108 installed on constitution.


JD

“Of course that’s just my opinion, I could be wrong . . .” Dennis Miller


Winston D. Neutel wrote in message
<9a7qqh$e4b$1@constitution.worldwebserver.com>…
>Peter N. Go <peter@icthus.net> wrote in message
>news:3AC7097B.9208DE5C@icthus.net
>> Using MIME::Lite should make things easy.
>
>Thought of that. Only MIME::Base64 and MIME::QuotedPrint are avaliable on wwsi,
>it seems. And neither of those actually send the mail themselves.
>
>In any case, there are other perl modules on wwsi which send mail, but the
>headers they set are not preserved. I tested that the perl stuff was working by
>redirecting output to a file, and the headers were there. But if they mail the
>output (or if I use ‘cat’ to pipe that file to sendmail myself), the headers
>are gone.

Re: sendmail and MIME

It works with MIME::Lite, but I’m confused as to why.

Lite.pm doesn’t actually send email, just constructs a MIME-format message which
you can then pipe to sendmail. I had tried three or four methods of doing the
exact same thing.

With all the methods, the headers were there if I piped output to stdout.

But only with MIME::Lite did the headers remain if I piped output to sendmail.

Using the exact same call to sendmail ("/usr/bin/sendmail -t -oi -oem")

Re: sendmail and MIME

“Winston D. Neutel” wrote:
>
> It works with MIME::Lite, but I’m confused as to why. Lite.pm doesn’t actually
> send email, just constructs a MIME-format message which you can then pipe to
> sendmail. I had tried three or four methods of doing the exact same thing.

It has routines to handle mail sending of the message it constructs. Check the
source and look for: sub send { … } sub send_by_sendmail { … }


Peter N. Go - mailto:peter@icthus.net

http://CGI-City.net http://BannerBuild.com http://BudgetWebHost.com
http://NewsCuts.com http://RegisterGuy.com http://WebPluck.com

        Earn Higher Commissions by Offering High-Margin Products
          <a href="http://quinst.com/c.jsp?area=inheichinherterselausen">http://quinst.com/c.jsp?area=inheichinherterselausen</a>