CDONTS或CDOSYS UTF-8电子邮件 [英] CDONTS or CDOSYS UTF-8 Email

查看:64
本文介绍了CDONTS或CDOSYS UTF-8电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要使用UTF-8

字符集处理国际字符的表单。我已经尝试了所有推荐的策略,从表单输入到电子邮件消息获取utf-8

字符,我无法让它工作。我需要和经典的asp一起使用。


这是我试过的一些东西:


' 'CDONTS

致电msg.SetLocaleIDs(65001)

''CDOSYS

msg.HTMLBodyPart.Charset =" utf- 8


我在电子邮件HTML中包含以下元标记:

< meta http-equiv =" Content-Type"含量=" text / html的; charset = utf-8">


我也尝试修改所有相关请求的CharSet和CodePage以及

回复。

我能够将回复的表格内容写回屏幕并且

它已正确呈现。但是,我的努力都无法通过正确的代码库将电子邮件发送到

渲染。我试过在Outlook中打开电子邮件

和Thunderbird。两个人都没有选择UTF-8字符集元标记。


任何帮助或教程链接都会有所帮助。


谢谢。

I have a form that needs to handle international characters withing the UTF-8
character set. I have tried all the recommended strategies for getting utf-8
characters from form input to email message and I cannot get it to work. I
need to stay with classic asp for this.

Here are some things I tried:

''CDONTS
Call msg.SetLocaleIDs(65001)

''CDOSYS
msg.HTMLBodyPart.Charset = "utf-8"

I included the following meta tag in the email HTML:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

I also tried modifying the CharSet and CodePage of all involved Request and
Responses.

I was able to Response.Write the form content on post back to the screen and
it was properly rendered. However, none of my efforts can get the email to
render with the correct codebase. I have tried opening the email in Outlook
and Thunderbird. Neither one picks up on the UTF-8 charset meta tag.

Any help or link to tutorial would help so much.

Thanks.

推荐答案



" Jed" < je **** @ newsgroups.nospamwrote in message

news:B0 ************************** ******** @ microsof t.com ...

"Jed" <je****@newsgroups.nospamwrote in message
news:B0**********************************@microsof t.com...

我有一个需要处理带有
的国际字符的表单
I have a form that needs to handle international characters withing the



UTF-8

UTF-8


字符集。我已经尝试了所有推荐的策略来获得
character set. I have tried all the recommended strategies for getting



utf-8

utf-8


从表格输入到电子邮件的字符消息,我无法让它工作。
characters from form input to email message and I cannot get it to work.




I


需要与经典的asp保持一致。


以下是我尝试的一些事情:


''CDONTS

致电msg.SetLocaleIDs(65001)


''CDOSYS

msg.HTMLBodyPart.Charset =" utf-8"


我在电子邮件HTML中包含以下元标记:

< meta http-equiv =" Content-Type"含量=" text / html的; charset = utf-8">


我也尝试修改所有涉及的请求
need to stay with classic asp for this.

Here are some things I tried:

''CDONTS
Call msg.SetLocaleIDs(65001)

''CDOSYS
msg.HTMLBodyPart.Charset = "utf-8"

I included the following meta tag in the email HTML:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

I also tried modifying the CharSet and CodePage of all involved Request



和$的CharSet和CodePage b $ b

and


回应。


我能够将回复的表格内容写回屏幕
Responses.

I was able to Response.Write the form content on post back to the screen




and


它已正确呈现。但是,我的努力都不能通过正确的代码库获得电子邮件
it was properly rendered. However, none of my efforts can get the email




to


render。我试过在
中打开电子邮件
render with the correct codebase. I have tried opening the email in



Outlook

Outlook


和Thunderbird。两个人都没有选择UTF-8字符集元标记。


任何帮助或教程链接都会有所帮助。
and Thunderbird. Neither one picks up on the UTF-8 charset meta tag.

Any help or link to tutorial would help so much.



在邮件中混合字符集是一个真正的雷区。在写完

任何内容之前先试试这个消息: -


oMsg.BodyPart.charset =" UTF-8"

其中oMsg是CDOSYS消息对象(不推荐使用CDONTS,不要写新的

代码)。


这将使所有文字部分都使用UTF-8编码。


Anthony。

Mixing charsets in a message is a real mine field. Try this before writing
any content to the message:-

oMsg.BodyPart.charset = "UTF-8"

Where oMsg is a CDOSYS message object (CDONTS is deprecated don''t write new
code against it).

That will make all text parts use UTF-8 encoding.

Anthony.


嘿,安东尼,


感谢您的建议。我对它的潜力持乐观态度,但它似乎没有什么区别。


这是我的代码:

msg.BodyFormat = 0''将正文设置为HTML = 0 TEXT = 1

msg.MailFormat = 0''将格式设置为MIME = 0 TEXT = 1

''调用msg.SetLocaleIDs(65001)

msg.Body =消息

msg.Send

''尝试将内容写入浏览器查看字符串是否坏

Response.Clear

''Response.CodePage = 65001

Response.CharSet =" utf- 8

Response.Write消息

Response.End


基本上如果我发布一些像?o [u with一个重音标记]它会在浏览器中渲染好b $ b,但是电子邮件会显示为??? o [A with tilde

over it,后面跟一个上标o]我认为这是ANSII的等价物

或者什么。


我读过绝对最低每个软件开发人员Abs olutely,

肯定必须知道Unicode和字符集(没有借口!)"

[ http://www.joelonsoftware.com/articles/Unicode.html] 但它似乎没有

可以解释为什么这不起作用。


嗯..


Anthony Jones写道:
Hey, Anthony,

Thanks for the suggestion. I was optimistic about its potential, but it
doesn''t seem to make a difference.

Here is my code:
msg.BodyFormat = 0 ''Set body text to HTML=0 TEXT=1
msg.MailFormat = 0 ''Set format to MIME=0 TEXT=1
''Call msg.SetLocaleIDs(65001)
msg.Body = Message
msg.Send
''Try writing the contents to the browser to see if the string is bad
Response.Clear
''Response.CodePage = 65001
Response.CharSet = "utf-8"
Response.Write Message
Response.End

Basically if I post some a character like ?o [u with an accent mark] it will
render fine in the browser, but the email it will appear as ???o [A with tilde
over it, followed by a superscript o] I think that is the ANSII equivalent
or something.

I have read "The Absolute Minimum Every Software Developer Absolutely,
Positively Must Know About Unicode and Character Sets (No Excuses!)"
[http://www.joelonsoftware.com/articles/Unicode.html] but it doesn''t seemed
to shed any light on why this isn''t working.

Hmm..

"Anthony Jones" wrote:

在邮件中混合字符集是一个真正的雷区。在写完

任何内容之前先试试这个消息: -


oMsg.BodyPart.charset =" UTF-8"

其中oMsg是CDOSYS消息对象(不推荐使用CDONTS,不要写新的

代码)。


这将使所有文本部分都使用UTF-8编码。


Anthony。

Mixing charsets in a message is a real mine field. Try this before writing
any content to the message:-

oMsg.BodyPart.charset = "UTF-8"

Where oMsg is a CDOSYS message object (CDONTS is deprecated don''t write new
code against it).

That will make all text parts use UTF-8 encoding.

Anthony.


实际上,这是我试过的CDOSYS代码。


msg.BodyPart.Charset =" utf-8"

msg.HTMLBody =消息

msg.HTMLBodyPart.Charset =" utf-8"

msg.Send


我在上一篇文章中意外复制了CDONTS代码。

Jed写道:
Actually, this is the CDOSYS code I tried.

msg.BodyPart.Charset = "utf-8"
msg.HTMLBody = Message
msg.HTMLBodyPart.Charset = "utf-8"
msg.Send

I accidentally copied the CDONTS code in the last post.
"Jed" wrote:

嘿,安东尼,



这是我的代码:

msg.BodyFormat = 0''将正文设置为HTML = 0 TEXT = 1

msg.MailFormat = 0''将格式设置为MIME = 0 TEXT = 1

''调用msg.SetLocaleIDs(65001)

msg.Body =消息

msg.Send

''尝试将内容写入浏览器查看字符串是否坏

Response.Clear

''Response.CodePage = 65001

Response.CharSet =" utf- 8

Response.Write消息

Response.End


基本上如果我发布一些像?o [u with一个重音标记]它会在浏览器中渲染好b $ b,但是电子邮件会显示为??? o [A with tilde

over it,后面跟一个上标o]我认为这是ANSII的等价物

或者什么。


我读过绝对最低每个软件开发人员A bsolutely,

肯定必须知道Unicode和字符集(没有借口!)"

[ http://www.joelonsoftware.com/articles/Unicode.html] 但它似乎没有

可以解释为什么这不起作用。


嗯..


Anthony Jones写道:
Hey, Anthony,

Thanks for the suggestion. I was optimistic about its potential, but it
doesn''t seem to make a difference.

Here is my code:
msg.BodyFormat = 0 ''Set body text to HTML=0 TEXT=1
msg.MailFormat = 0 ''Set format to MIME=0 TEXT=1
''Call msg.SetLocaleIDs(65001)
msg.Body = Message
msg.Send
''Try writing the contents to the browser to see if the string is bad
Response.Clear
''Response.CodePage = 65001
Response.CharSet = "utf-8"
Response.Write Message
Response.End

Basically if I post some a character like ?o [u with an accent mark] it will
render fine in the browser, but the email it will appear as ???o [A with tilde
over it, followed by a superscript o] I think that is the ANSII equivalent
or something.

I have read "The Absolute Minimum Every Software Developer Absolutely,
Positively Must Know About Unicode and Character Sets (No Excuses!)"
[http://www.joelonsoftware.com/articles/Unicode.html] but it doesn''t seemed
to shed any light on why this isn''t working.

Hmm..

"Anthony Jones" wrote:

在邮件中混合字符集是一个真正的雷区。在写完

任何内容之前先试试这个消息: -


oMsg.BodyPart.charset =" UTF-8"

其中oMsg是CDOSYS消息对象(不推荐使用CDONTS,不要写新的

代码)。


这将使所有文本部分都使用UTF-8编码。


Anthony。


Mixing charsets in a message is a real mine field. Try this before writing
any content to the message:-

oMsg.BodyPart.charset = "UTF-8"

Where oMsg is a CDOSYS message object (CDONTS is deprecated don''t write new
code against it).

That will make all text parts use UTF-8 encoding.

Anthony.


这篇关于CDONTS或CDOSYS UTF-8电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆