Multiple questions about Database Mail

  • MSDN defines Database Mail profiles as:

    Database Mail profiles are collections of SMTP accounts.

    1. This seems to me to be nothing more than a way to group email accounts for sending mail from the server. A container of sorts. Does anyone have a better way to articulate it? Am I right in my description?

    2. If I am indeed correct in my description, what would be a good naming policy for profiles of this kind? "Anything you want" just doesn't do it for me. I am a tad bit OCD and I need it to be descriptive. But what does it describe exactly? I used "Database Administration" for my initial test run. I had initially started to name it "Database Mail Administration Profile" but then I remember reading articles about how people still named things with "tbl", "sp"(I know this is bad practice), and such because of older versions of Access and Hungarian notation but today it isn't such an honored practice. What does everyone name theirs?

    3. Do you have multiple profiles?

    4. Is it bad practice to have it public for general maintenance notifications of job failure?

    5. Does anyone have a "Best Practice" or interesting tid-bit concerning Database Mail Profiles?

    6. Why is there an "Enable mail profile" in "SQL Server Agent>Properties>Alert System>Mail session"? What does this do for me? I already have a maintenance plan sending me mail without this turned on.

    Once I have these down, I am on to accounts 🙂

  • you are pretty much on target as far as profiles being a container; they are also a handy reference for which email account to use;

    on my server, i have 4 profiles, one for each of the three websites i host, and another one that uses a gMail account, just to prove you can set up dbMail with a gMail account for those posters who don't want to use their personal email for testing DBMail.

    depending on the business process, such as a marketing campaign, it's good to know the Whatever.Com profile is sending out the contact emails and so on for a specific campaign.

    now why you need multiple accounts under a given profile, i dunno about that.

    this is my "gMail" profile's account settings

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I personally appreciate the post. I will piggy back on this post once the originator has made their comments. I have some questions....:-)

  • Lowell,

    Thanks for your reply. What did you name your Profiles? Do you have a naming scheme for them? And do you know anything about question 6?

  • in my case, each of my profiles mirror the email accout they are going to send from...

    without pushing my own sites on you poor saps,

    i'd create one named "sqlservercentral" for a profile that would be sending using a sqlservercentral.com email address,

    and a different one for "sqlshare" for sqlshare.com email campaigns,

    and a "redgate" for redgate.com emails....

    so if i was going to send out a newsletter, after building up the html to send out, it would be fairly intuitive for me to know my sqlservercentral newsletter should be sent out by the profile "sqlservercentral".

    if i named them any thing else, there would always be the need to cross reference stuff... some developer asking me "what email does the profile named "Default" use....

    for question 6, you've got me...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Interesting, so your profiles reflect the email account you are sending from rather than the who you are sending to. So, when you have more than one person that you want to notify for a given notification, do you configure that in the email application (ie. using a distribution list?).

  • well in my case, I might be sending hxkresl@gmail.com,lowell@yahoo.com and jason.stephens @bing.com all the same email....

    all those emails are going to be in a table with all my contacts, right? some business process gathers thos eemails and what those people might be interested in.

    and if they expressed an interest in say, Chinese Banana Slugs, i might create an email all about them and send that email with my profile "ChineseBananaSlugs.com", so we all get the latest newsletter about this latest culinary delicacy. it wouldn't be right to send that from an address that was all about technical SQL server Details, right?

    That's how i treat my profiles...as the automated /no-need-to-see-the-details portion of the "FROM" email info.

    so to send those three people emails, i'd end up having some looping construct send each email seperately for each email address calling msdb.dbo.sp_send_dbmail once for each email, so that i don't expose lots of users emails to the other recipietns.

    you could also bcc everyone in one big blast, but it gives you the option to personalize each email by doing it one at a time.

    hxkresl (7/6/2010)


    Interesting, so your profiles reflect the email account you are sending from rather than the who you are sending to. So, when you have more than one person that you want to notify for a given notification, do you configure that in the email application (ie. using a distribution list?).

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Super. I appreciate a concrete example of using sp_send_dbmail in a production environment.

    Thanks!

  • It would also make sense that the person receiving the email would not need to know there role, but rather where the email is coming from. So the naming of the email should be somewhat reveling as to what is contained in the email.

    Anthony K. Johnson

Viewing 9 posts - 1 through 8 (of 8 total)

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