email and sms

  • I have this code

    use IT

    go

    Create Trigger Notify

    on IT.WorkRequest

    for insert ,update, delete

    as

    begin

    set nocount on;

    DECLARE @body NVARCHAR(MAX) = N'';

    SELECT @body += char(25) + char(25) + char(4) + char(255) + (Department) +' '+ (Problem) +' ' +(Completed) +' ' +(Notes) FROM inserted;

    IF EXISTS (SELECT 1 FROM inserted)

    BEGIN

    exec msdb.dbo.sp_send_dbmail

    @profile_name = 'Work',

    --@recipients = 'eddie.hall76@gmail.com',

    @recipients = '**********@txt.att.net ; edward_hall76@hotmail.com',

    @subject = 'Data Inserted into WorkRequest',

    @body = @body

    end

    end

    it sends the message to email with the information that was put inserted into the table but the message sent to the phone is blank any suggestions.

  • Ed, I'm not seeing the variable where the data is actually included (@attach_query_result_as_file). Are you attaching a file with the data or is it being put right into the body of the message? Review your options here: http://msdn.microsoft.com/en-us/library/ms190307.aspx

    --------
    For SQL Tips, check out my blog: http://lantztechknowledge.blogspot.com/[/url]
    You can also follow my twitter account to get daily updates: @BLantz2455

  • Since the email contains the data to a regular email address and not to the SMS (phone), I'd try shrinking the message down or simplifying the message until I got a successful send to the ATT SMS address.

    It looks like what you are trying to send would be broken up into 3 messages and maybe ATT is just killing the body due to size.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I am not sending a file just what was inserted into the table.

    Changing the @body nvarchar(255) now it works

    Thanks for both of yawl's help

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply