Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a profile called GPMail, and previously there was an account called comments@guitarplayer.com, which was working as expected.

Now I want one more account with the same site, so instead of creating new profile I created new account called password@guitarplayer.com inside the same profile. But now when I try to send mail for password, I do not get the option for the account in the stored procedure -- sp_send_dbmail, so whenever I send the mail, the from field has the comments@guitarplayer.com address instead of password@guitarplayer.com.

Is there anyway that I can specify the account name too with Profile name while sending mails?

share|improve this question
    
@Abbas, I added more to my response below. –  samsmith Jan 30 '12 at 1:58
add comment

migrated from stackoverflow.com Jan 27 '12 at 21:29

This question came from our site for professional and enthusiast programmers.

1 Answer

Depending on the method you use for sending mail: Yes

If you use sp_send_dbmail (which is what I use), then yes, you can set the FROM address in the call to send mail.

See docs: http://msdn.microsoft.com/en-us/library/ms190307.aspx

@from_address is what you want, I believe

If you want to actually log in to the mail server as a diff user, then you need to mod the profile or create a new one. The auth to the mail server is configured in the profile.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.