0

I am trying to get SQL database mail to send emails using a new db mail profile and account. The new db mail profile and account that I am creating uses the exact same server name as the old db mail profiles and accounts on our server. Whenever I execute the command:

      EXEC        msdb.dbo.sp_send_dbmail 
              @profile_name = 'OLD PROFILE NAME', 
              @recipients = 'myEmail@email.com',   
              @subject = 'Test Email',   
              @body = '<html><body><p>test content test content test content   test content test content</p></body></html>',
              @body_format = 'HTML';

And email sends with no issues. However whenever I execute the command

 EXEC        msdb.dbo.sp_send_dbmail 
              @profile_name = 'NEW PROFILE NAME', 
              @recipients = 'myEmail@email.com',   
              @subject = 'Test Email',   
              @body = '<html><body><p>test content test content test content   test content test content</p></body></html>',
              @body_format = 'HTML';

I don't get an email. Whats even weirder is that I can look at the sent items using a msdb command and its saying that the emails that I am not getting are being sent??

Any thoughts or help would be greatly appreciated

Connor Williams
  • 319
  • 2
  • 13
  • If we could look at the profiles it might help. For instance the smtp server in the profiles are they the same? – Sam Jun 22 '16 at 14:49

1 Answers1

0

Have you tried looking at the email profiles?

(In Management Studio->Database Mail->Configure Database Mail->Manage Database Mail accounts and profiles->View, change or delete an existing profile... )

Check the two profiles. See if there is an SMTP account to the two profiles and if they are valid.

My guess is that the SMTP account associated to the new profile is not valid.

Danielle Paquette-Harvey
  • 1,691
  • 1
  • 16
  • 31
  • I just tried changing the SMTP account to my email address (which is a valid account on my company's SMTP server) and still no luck. – Connor Williams Jun 22 '16 at 14:57
  • Have you verified that the SMTP account for the email profile is configured the same way as the old profile? (You can see SMTP account configuration by the option : Database Mail->Configure Database Mail->Manage Database Mail accounts and profiles->View, change or delete an existing account ) – Danielle Paquette-Harvey Jun 22 '16 at 15:12
  • Check the SSL configuration, the authentification. You can also try sending a test email via Management Studio with the different profiles. – Danielle Paquette-Harvey Jun 22 '16 at 15:13