Database Mail

  • Hi,

            I am sending EMails from the database in SQL Server 2005 using Database Mail feature. Works fine. Now, the customer is saying all the 'From' addresses on the mails have the same EMail address. Which is correct because it is the EMail address I set up in the mail profile.

           The customer wants that address to be different, namely the EMail address of the office or some other address following his business rules.

            Is there a way I can do this without creating additional Mail Profiles? Because there are too many offices for this client.

            In other words, is there a way to send an email through SQL Server without using mail profiles?

           Or if I have to use the mail profile, is there a way I can change the email address on the mail profile dynamically?

     

    Thanks

    Vishy Dhara

  • Small update. I found there is one way you can do it. By updating the

    sysmail_account table in msdb.

    So I take the records into a loop update the table with the mail address I want and put the original back at the end.

    Is there any other way? Also is there any problem with the above approach?

     

    Vishy Dhara

     

Viewing 2 posts - 1 through 1 (of 1 total)

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