As per $BILL, it's probably best to use MIME::LITE available via PPM. I'm using it currently
and makes sending any text/html or multipart mail very easy...
-----Original Message-----
From: Scot Robnett [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 26, 2001 3:29 PM
To: [EMAIL PROTECTED]
Subject: Sending HTML mail using Win32::OLE::Const
Can anyone tell me how to set the BodyFormat option to 0 in order to send
mail as MIME type text/html rather than text/plain? I've tried several
approaches to setting that option on the mail object but to no avail.
The following sends text/plain:
##########################################################
use Win32::OLE::Const("Microsoft CDO for NTS 1.2 Library");
my $subject = "foo";
my $body = <<"END_OF_BODY";
<html><head><title>Test</title></head>
<body bgcolor="#ffffff">
<h2>Test</h2>testing 1 2 3</body></html>
END_OF_BODY
my $to = "foo\@bar.com";
my $from = "bar\@foo.com";
my $objMail = Win32::OLE->new("CDONTS.Newmail");
$objMail->Send($from,$to,$subject,$body,CdoHigh);
##########################################################
Doing any of the following not only does not send HTML mail, but prevents
the mail from being sent at all:
##########################################################
$objMail->{BodyFormat} = 0; # doesn't complain
# but doesn't send
# or
$objMail->{'BodyFormat'} = '0'; #doesn't complain
# but doesn't send
# or
$objMail->('BodyFormat') = 0; # doesn't complain
# but doesn't send
# or
$objMail->("BodyFormat") = 0; # doesn't complain
# but doesn't send
# or
$objMail->("CDONTS.BodyFormat") = 0; # doesn't complain
# but doesn't send
#or
$objMail->BodyFormat($body) = 0; # produces an error
##########################################################
The MSDN site shows you how to set it this way with VB but (surprise) there
is no Perl documentation:
myMail.BodyFormat = 0;
-----
Scot Robnett
inSite Internet Solutions
Square West Center
454 West Jackson Street
Woodstock, IL 60098
(815)206-2907 office
(815)342-6480 mobile
[EMAIL PROTECTED]
http://www.insiteful.tv
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 11/1/2001
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
********************************************************
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message that arise as a result of e-mail transmission. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments.
All e-mails at Neuberger Berman are, in accordance with Firm policy, to be used for Neuberger Berman business purposes only. E-mails sent from or to the Firm are subject to being reviewed by the Firm in accordance with the Firm's procedure for the review of correspondence.