Jump to content

Send HTML Body with _INetSmtpMail


Recommended Posts

Hello again,

I'm using the _INetSmtpMail from <Inet.au3> but unfortunately it doesn't send <html> content.

Ofc I looked up the code in Inet.au3 and found the content-Type entry but I don't know what I have to modify to make it work. Anyone an idea ?

$aSend[4] = "From:" & $sFromName & "<" & $sFromAddress & ">" & @CRLF & _
            "To:" & "<" & $sToAddress & ">" & @CRLF & _
            "Subject:" & $sSubject & @CRLF & _
            "Mime-Version: 1.0" & @CRLF & _
            "Date: " & _DateDayOfWeek(@WDAY, 1) & ", " & @MDAY & " " & _DateToMonth(@MON, 1) & " " & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & $iBias & @CRLF & _
            "Content-Type: text/plain; charset=US-ASCII" & @CRLF & _
            @CRLF
    $aReplyCode[4] = ""

 

Link to comment
Share on other sites

@TheDcoder

Wow that was simple ..😅
Thank you !!!!
Now I need to solve one last thing.

How I can display special characters "ÄÜÖäüö °!"§$$%&/()=?@€1²³456{[]}\~#-.,|" etc ?
The mails I receive and send can only display this ones !"$%&/()=?'_:;>{[]}\~|

Most important are the special letter characters "ÄÖÜ"

 

Link to comment
Share on other sites

@Nine

I checked the charset in my Outlook 2016 Client and it use "Western European (ISO)" by default.
So in the end "ISO-8859-1" was the correct charset 🕵️‍♂️

$aSend[4] = "From:" & $sFromName & "<" & $sFromAddress & ">" & @CRLF & _
            "To:" & "<" & $sToAddress & ">" & @CRLF & _
            "Subject:" & $sSubject & @CRLF & _
            "Mime-Version: 1.0" & @CRLF & _
            "Date: " & _DateDayOfWeek(@WDAY, 1) & ", " & @MDAY & " " & _DateToMonth(@MON, 1) & " " & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & $iBias & @CRLF & _
            "Content-Type: text/html; charset=ISO-8859-1" & @CRLF & _
            @CRLF
    $aReplyCode[4] = ""

This community is the best !

Edited by AndroidZero
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...