【问题标题】:DB Mail is working with other carriers but not sprintDB Mail 正在与其他运营商合作,但不与 sprint
【发布时间】:2019-08-15 16:19:05
【问题描述】:

因此,数据库邮件程序将短信发送到 Verizon、att、Cricket 等。但是当使用 messing.sprintpcs.com 发送到 sprint 电话号码时,他们会收到一条看起来像是加密消息的文本。

我们尝试过使用不同的 sprint 用户和不同的手机。所有相同的结果。

感谢您的宝贵时间。

【问题讨论】:

  • 您发送的是纯文本还是html?另外,你试过@pm.sprint.com
  • 是的,我们已经尝试过@pm.sprint.com 他们收到了主题,但正文仍然是乱码。字符串中没有 HTML。
  • 那我联系sprint。
  • 离题,因为问题是第三方应用程序独有的。
  • @scsimon 想通了。它是 sp_send_dbmail 上的 body_format。谢谢。

标签: sql-server sprint database-mail dbmail


【解决方案1】:

我的问题是 sp_send_dbmail 的 @body_format 设置为“html”。虽然其他服务对此没有问题,但 Sprint 有导致问题的严格字符限制。

DECLARE @BodyFormat nvarchar(20) = 'HTML'

IF ISNUMERIC(SUBSTRING(@EmailTo, 1, 7)) = 1
    SET @BodyFormat = 'TEXT'

EXEC msdb.dbo.sp_send_dbmail
                @profile_name = 'Profile',
                @from_address = @EmailFrom,
                @recipients = @EmailTo,
                @copy_recipients = @CC,
                @blind_copy_recipients = @BCC,
                @subject = @Subject,
                @body = @Body,
                @mailitem_id = @MailItemID OUTPUT,
                @body_format = @BodyFormat;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-03-29
    • 2013-08-23
    • 2023-03-15
    • 2010-10-07
    • 2020-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多