問題描述
我正在嘗試發送一封包含阿拉伯文本的電子郵件,我的問題是當我將阿拉伯文本添加到電子郵件中時,它會將其更改為隨機字母(與電子郵件的字符編碼有關 - 我可以't改變).
I'm trying to send an email containing Arabic text, my problem is that when I add the Arabic text to the email, it changes it to random letters (to do with the character encoding of the email - which I can't change).
是否有內置函數或自定義函數可用于將阿拉伯語轉換為 HTML 代碼 (?),以便隨后出現在我的 HTML 電子郵件中?
Is there a built in function or a custom function I can use to convert the Arabic to HTML Codes (ا) so it will then appear in my HTML email?
推薦答案
保留 HTML 轉義符(例如 ס
),并通過設置 ContentType
到 text/html
Leave the HTML escapes (ex ס
) in, and turn the e-mail to HTML by setting ContentType
to text/html
'Create mailer
mailer.ContentType = "text/html"
'User mailer
要將 unicode 轉換為 HTML 轉義,您可以使用內置函數 HTMLEncode.
To convert the unicode to HTML escapes you can use the built in function HTMLEncode.
mailer.BodyText = Server.HTMLEncode(body)
注意:您的查看器需要安裝適當的字形集.
這篇關于將阿拉伯文本轉換為 HTML 代碼字符的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!