spMFValidateEmailProfile

Returns
  • 1 = Profile is valid

  • -1 = Profile is invalid and no default profile exists

Parameters
@emailProfile nvarchar(100) (input/output)
  • Input: the profile name to validate

  • Output: when NULL or invalid, set to the default profile (if available)

@Debug smallint (optional)
  • Default = 0

  • 1 = Standard Debug Mode

Purpose

To validate the email profile or return the default profile from the settings table MFSettings.

Additional info

  • If @emailProfile is NULL, the default profile is returned (if configured).

  • If @emailProfile names a non-default profile, it validates that profile; if invalid, it falls back to the default profile (if available).

  • If both the provided profile and the default profile are invalid, the procedure returns -1.

Examples

EXEC dbo.spMFValidateEmailProfile 'MailProfile';

Using a custom profile that is not the default profile

DECLARE @profile NVARCHAR(100) = 'TestProfile';
EXEC dbo.spMFValidateEmailProfile @emailProfile = @profile OUTPUT;
SELECT @profile AS EffectiveProfile;

Changelog

Date

Author

Description

2025-07-24

LC

Set return value to 1

2021-01-20

LC

Allow for multiple profiles

2017-05-01

LC

Fix validate profile

2016-10-12

LC

Change Settings Name

2016-08-22

LC

update settings index

2015-12-10

AC

Create procedure