ElaBela has asked for the wisdom of the Perl Monks concerning the following question:

Hello Dear Monks!
Does anybody know how can I modify charset and content-transfer-encoding of email message created with Win32::OLE?

Thanks a lot, ElaBela

  • Comment on charset and content transfer encoding with Win32::OLE

Replies are listed 'Best First'.
Re: charset and content transfer encoding with Win32::OLE
by psychotic (Beadle) on Dec 06, 2005 at 17:07 UTC
    Since Win32::OLE does not serve the purpose of creating and sending e-mails, you should at least provide some information about the application you are attempting to script, and what the problem seems to be. You should also give some information regarding the source of the data sent. For instance, specifying a UTF-8 charset for ISO-8859-7 originated data will most likelly break unless the proper (en|de)coding has taken place beforehand.
      I should be able to send various emails via Outlook. I succeeded to modify the Content-Type in the following way:
      my $mail = new Win32::OLE('Outlook.Application'); my $ol = Win32::OLE::Const->Load($mail); my $item = $mail->CreateItem(0); $item->{'To'} = "stam@walla.com"; $item->{'Subject'} = "important"; $item->{'BodyFormat'} = "olFormatHTML"; $item->{'HTMLBody'} = "<HTML><H2>The body of this message will appear +in HTML.</H2><BODY>Type the message text here. </BODY></HTML>";
      But I also should be able to modify the Content-Transfer-Encoding and the charset.
      The Content-Transfer-Encoding types that I'm interested in are UUEncode, QPrint, Base64
      No special preferences for charset, since I should test as many as possible.
      Any help would be appreciated,
      ElaBela