Skip to main content

Configure Database Mail - Send Email From SQL Database

http://www.codeproject.com/Articles/29060/SQL-SERVER-2008-Configure-Database-Mail-Send-Email

1. create profile
2.  configure email
     run this code for configure
    sp_CONFIGURE 'show advanced', 1
   GO
   RECONFIGURE
   GO
   sp_CONFIGURE 'Database Mail XPs', 1
   GO
   RECONFIGURE
   GO
3. Send mail

EXEC sp_send_dbmail @profile_name='Test',
@recipients='test@example.com',
@subject='Test message',
@body='This is the body of the test message. sent through DataBase mail'

Comments

Popular posts from this blog

Remove Duplicate Row in Sql Query

Method 1: -- Create Sample Table DECLARE @ table TABLE ( data VARCHAR ( 20 ) ) -- Insert Some Data INSERT INTO @ table VALUES ( 'not duplicate row' ) INSERT INTO @ table VALUES ( 'duplicate row' ) INSERT INTO @ table VALUES ( 'duplicate row' ) -- Find out Duplicate rows in table : SELECT   data , COUNT ( data ) nr FROM     @ table GROUP BY data HAVING   COUNT ( data ) > 1 -- Remove Duplicate rows from table SET NOCOUNT ON SET ROWCOUNT 1 WHILE 1 = 1    BEGIN       DELETE    FROM @ table       WHERE     data IN ( SELECT   data                                FROM     @ table            ...

Sql Helper into Xamarin Forms PCL Project

public abstract class SQLiteConnection : IDisposable { public string DatabasePath { get ; private set ; } public bool TimeExecution { get ; set ; } public bool Trace { get ; set ; } public SQLiteConnection ( string databasePath) { DatabasePath = databasePath; } public abstract int CreateTable < T > (); public abstract SQLiteCommand CreateCommand ( string cmdText, params object [] ps); public abstract int Execute ( string query, params object [] args); public abstract List < T > Query < T > ( string query, params object [] args) where T : new (); public abstract TableQuery < T > Table < T > () where T : new (); public abstract T Get < T > ( object pk) where T : new (); public bool IsInTransaction { get ; protected set ; } public abstract void BeginTransaction (); public abstract void Rollback (); public abstract void Co...