通过System.Net.Mail电子邮件中的强调字符 [英] Accentuated characters in email via System.Net.Mail

查看:137
本文介绍了通过System.Net.Mail电子邮件中的强调字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一段代码将Outlook的HTML签名合并到电子邮件设置中(以下代码).

但是,当字符串包含强调字符(即é)时,通过.NET Mail对象发送的电子邮件将其替换为?".特点.无论如何,要保留重音符号,或者至少将其转换为其重音符号吗?

干杯

Hi,

I''ve a segment of code which combines the HTML signature from Outlook into an email settings (Code below).

However, when the string contains accentuated characters (ie, é), the emails sent through the .NET Mail objects replace them with the "?" character. Is there anyway to retain the accentuated characters, or at least convert them to their unaccentuated equilavent?

Cheers

<br />
    If Not mailMsg.IsBodyHtml Then<br />
      htmlMailComposed = "<body>" & Replace(Replace(Replace(Replace(Replace(mailMsg.Body, "<", "<"), ">", ">"), vbCrLf, "<br>"), vbCr, "<br>"), vbLf, "<br>") & htmlMailOutput & "</body>"<br />
      mailMsg.IsBodyHtml = True<br />
      mailMsg.Body = htmlMailComposed<br />
    Else<br />
      mailMsg.Body = Replace(mailMsg.Body, "</body>", htmlMailOutput & "</body>", , , CompareMethod.Text)<br />
    End If<br />
</br></br></br>

推荐答案

尝试更改

这篇关于通过System.Net.Mail电子邮件中的强调字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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