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]
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: