I'm sending emails directly to Microsoft Outlook accounts from SQL Server 2008. Everything is fine, email was sent. Only problem is that in the header of the email the SQL Server name is embedded.

I've tried specifying the @from_address when executing the mail sending in DB but the sql server name is still there in the email's header. I don't want my recipients to see the sql server name in the header.

Is there a way to block this?

Thanks much!


2 Answers 2


Try creating a new database mail profile and database mail account. Put the email address you desire as the name of the new mail account. Then use the profile when calling the stored procedure to send email: EXEC msdb.dbo.sp_send_dbmail
@profile_name = "DB Mail Profile"



You need to manage the information for your Database Mail Configurations. There are two things to be concerned with:

  • Database Mail Profiles
  • Database Mail Accounts

The From and Reply-To email addresses are stored as part of the database mail account. The account is, in turn, associated with a profile. Multiple accounts can be associated with a profile and multiple profiles can exist. One profile will be set as a default for use by the mail processes and that's likely where your From address is being taken from.

You can view your mail information using the following:

    p.name [Profile Name]
    ,p.description [Profile Description]
    ,a.name [Account Name]
    ,a.display_name [Account Display Name]
    ,a.email_address [From Address]
    ,a.replyto_address [ReplyTo Address]
    msdb.dbo.sysmail_profile p
    JOIN msdb.dbo.sysmail_principalprofile pp ON (p.profile_id = pp.profile_id)
    JOIN msdb.dbo.sysmail_profileaccount pa ON (p.profile_id = pa.profile_id)
    JOIN msdb.dbo.sysmail_account a ON (pa.account_id = a.account_id);

To resolve your issue, you have three approaches:

  • Update your From address for the account associated to your current default profile:

    exec sysmail_update_account_sp @account_id=[account ID], @email_address=[From address]

  • Create a new profile and make it your default, then add an appropriate account with the necessary information.

  • Create a new profile, add your new information, and call it explicitly using exec sp_send_dbmail @profile_name='[profile name]'

You can manage all this using the Database Mail Stored Procedures or using SSMS under Management->Database Mail:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.