Jump to content

_INetSmtpMail wont send national characters


Recommended Posts

Hello,

I have a script with _INetSmtpMail. Generaly same as example

#include <INet.au3>

$s_SmtpServer = "mysmtpserver.com.au"
$s_FromName = "My Name"
$s_FromAddress = "From eMail Address"
$s_ToAddress = "To eMail Address"
$s_Subject = "My Test UDF"
Dim $as_Body[2]
$as_Body[0] = "Testing the new email udf"
$as_Body[1] = "Second Line"
$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
$err = @error
If $Response = 1 Then
    MsgBox(0, "Success!", "Mail sent")
Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
EndIf

It works fine, but it is not able to handle national characters

This

příliš žluťoučký kůň úpěl ďábelské ódy

comes as

p??li? ?lu?ou?k? k?? ?p?l ??belsk? ?dy

So my thoughts were - I am running quite old Autoit version 3.3.6.1 I should update it. I did that to latest possible and ooops the example script does not work anymore with

_inetsmtpmail error code 4

#include <Inet.au3>
#include <MsgBoxConstants.au3>

Local $s_SmtpServer = "mysmtpserver.com.au"
Local $s_FromName = "My Name"
Local $s_FromAddress = "From eMail Address"
Local $s_ToAddress = "To eMail Address"
Local $s_Subject = "My Test UDF"
Local $as_Body[2]
$as_Body[0] = "Testing the new email udf"
$as_Body[1] = "Second Line"
Local $iResponse = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
Local $iErr = @error
If $iResponse = 1 Then
    MsgBox($MB_SYSTEMMODAL, "Success!", "Mail sent")
Else
    MsgBox($MB_SYSTEMMODAL, "Error!", "Mail failed with error code " & $iErr)
EndIf

Any tips how to fix this or troubleshoot that? Unfortunately I have no access to smtp server...

Thanks for tips

VP

Edited by VojtechPechar
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...