AutoIt Requires Chilkat v11.0.0+
AutoIt
Choose the character set for an HTML email
See more Email Object Examples
Read a UTF-8 HTML file as Unicode, then set the charset Chilkat will use when writing the MIME text. The HTML file’s input encoding and the message’s output charset are separate choices. UTF-8 can represent names from multiple writing systems.
Chilkat AutoIt Downloads
Local $bSuccess = False
; Assumes Chilkat is unlocked. See Global Unlock Sample.
$oEmail = ObjCreate("Chilkat.Email")
$oEmail.From = "Workshop team <events@example.com>"
$bSuccess = $oEmail.AddTo("Alex Rivera","alex@example.net")
If ($bSuccess <> True) Then
ConsoleWrite($oEmail.LastErrorText & @CRLF)
Exit
EndIf
$oEmail.Subject = "Workshop registration"
$oHtml = ObjCreate("Chilkat.StringBuilder")
$bSuccess = $oHtml.LoadFile("newsletter.html","utf-8")
If ($bSuccess <> True) Then
ConsoleWrite("Failed: html.LoadFile." & @CRLF)
Exit
EndIf
$oEmail.Charset = "utf-8"
$oEmail.SetHtmlBody $oHtml.GetAsString()
$bSuccess = $oEmail.SaveEml("newsletter.eml")
If ($bSuccess <> True) Then
ConsoleWrite($oEmail.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Saved newsletter.eml." & @CRLF)