-1

So the database mailer sends the sms to Verizon, att, Cricket etc.. but when sending to a sprint phone number using messaging.sprintpcs.com they receive a text with what looks to be the message encrypted.

We have tried with with different sprint users and different phones. All the same results.

Thank you for your time.

Tyriddik
  • 104
  • 1
  • 6
  • 1
    Are you sending plaintext or html? Also, have you tried `@pm.sprint.com` – S3S Aug 15 '19 at 16:30
  • Yes we have tried @pm.sprint.com they receive the subject but the body is still garbled. There is no HTML in the string. – Tyriddik Aug 15 '19 at 16:35
  • Then I'd contact sprint. – S3S Aug 15 '19 at 16:37
  • Off-topic because issue is unique to third party application. – S3S Aug 15 '19 at 16:37
  • @scsimon figured it out. It was the body_format on sp_send_dbmail. Thank you. – Tyriddik Aug 16 '19 at 20:42
  • But you said you were sending plain text already (my first comment)... looks like you weren't... and TEXT is the default so you would have had to explicitly tell it to send HTML. – S3S Aug 16 '19 at 20:53
  • I didn't have access to the trigger to see what sp was being called in a legacy application. Documentation pointed to plain text and there was no htlm in the string. But after your comments I was able to find a few things and request more information from the dba. Again, thank you. – Tyriddik Aug 17 '19 at 03:51

1 Answers1

0

My issue was that @body_format of the sp_send_dbmail was set to 'html'. While other services were okay with this, Sprint has strict character limits that were causing issues.

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;
Tyriddik
  • 104
  • 1
  • 6