【问题标题】:Is there anyway to display Right To Left plain text mails?无论如何显示从右到左的纯文本邮件?
【发布时间】:2011-04-14 14:37:26
【问题描述】:

我正在使用 SmtpClient 在 C# 中发送邮件。 我以纯文本形式发送邮件:

message.IsBodyHtml =False;

如何将它们作为 RTL 发送?使用 HTML 邮件非常简单——只需将它们标记为 RTL。

示例代码:

    public void SendEmail(bool isJapanese)
    {
        try
        {
            MailAddress from = new MailAddress(FromEmail,FromDisplay);
            MailAddress to = new MailAddress(ToEmail, ToDisplay);
            MailMessage message = new MailMessage( from, to);
                message.Subject = Subject;
            if (!IsHTML)
                Body = Body.Replace("<br/>", "\r\n").Replace("<br/>", "\r").Replace("<br/>", "\n");
            message.Body =Body;

            message.BodyEncoding = Encoding.UTF8;
                message.SubjectEncoding = Encoding.UTF8;
            message.IsBodyHtml = IsHTML;
            smtpClient.Send(message);
        }
        catch (Exception ex)
        {
            ex.HelpLink += "class MailSender, fn SendMail(); ";
            Log(ex);
        }
    }

【问题讨论】:

    标签: c# sendmail right-to-left plaintext mailmessage


    【解决方案1】:

    没有办法确定纯文本邮件的对齐方式。 顺便说一句-Gmail 正在自动检测 RTL 语言,但这是我看到的唯一提供者。

    【讨论】:

      猜你喜欢
      • 2021-11-29
      • 2022-01-18
      • 1970-01-01
      • 2015-07-11
      • 1970-01-01
      • 2019-02-12
      • 1970-01-01
      • 2013-06-21
      • 2017-04-11
      相关资源
      最近更新 更多