Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Database Mail - Specify "reply to" dynamically?

Author  Topic 

ferrethouse
Constraint Violating Yak Guru

352 Posts

Posted - 2009-09-21 : 13:36:15
I've setup a Database Mail profile called "SendEmailProfile" which contains an account called "SendEmailAccount". I setup the "reply to" email address at design time. The problem is that I need to change the "reply to" depending on the client account in our application that is being used.

One option would be to create 50 accounts each with the appropriate "reply to" address. But that would be logistically prohibitive to maintain.

Is there a way to programmatically change the "reply to" for the account prior to sending the email using Database Mail?

Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-09-21 : 15:14:14
You are asking a lot from Database Mail. It isn't really setup to be used like you want, it's just a dumb email process. I'd instead looking into performing the email on the client side where you'd be able to program exactly what you want.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -