title: dbmail is not working in sql localdb in visual studio
body: <p>I'm trying to send email with activation link whenever a new user register on my website. but I'm getting activation failure after sending the email from localdb (SQL Server Express)</p>
  
  <p>This is what I've tried</p>
  
  <pre><code>--Enabling Database Mail
  sp_configure 'show advanced options',1
  reconfigure
  go  
  sp_configure 'Database Mail XPs',1
  reconfigure
  
  --Creating a Profile
  EXECUTE msdb.dbo.sysmail_add_profile_sp
  @profile_name = 'Send_Mail',
  @description = 'Sending Mail On Register and on some other activity.' ;
  
  -- Create a Mail account for gmail. We have to use our company mail account.
  EXECUTE msdb.dbo.sysmail_add_account_sp
  @account_name = 'Send_Email_Register',
  @email_address = 'abc@gmail.com',
  @mailserver_name = 'smtp.gmail.com',
  @port=587,
  @enable_ssl=1,
  @username='abc@gmail.com',
  @password='Emailid password'
  
  -- Adding the account to the profile
  EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
  @profile_name = 'Send_Mail',
  @account_name = 'Send_Email_Register',
  @sequence_number =1 ;
  
  -- Granting access to the profile to the DatabaseMailUserRole of MSDB
  EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
  @profile_name = 'Send_Mail',
  @principal_id = 0,
  @is_default = 1 ;
  
  --Sending Test Mail
  EXEC msdb.dbo.sp_send_dbmail
  @profile_name = 'Send_Mail',
  @recipients = 'recipient@gmail.com',
  @body = 'Database Mail Testing...',
  @subject = 'Databas Mail from SQL Server';
  
  --Verifying, check status column
  select * from sysmail_allitems 
  </code></pre>