Solved

How can I Sende email notification Form Shaduled job in sql server 2008

Posted on 2011-09-14
12
567 Views
Last Modified: 2012-05-12
Hi experts:


I hope somebody can help in this
I need to receive email notification when my job tasks in sql server succeed or competed or failed
I did the following
1 - I configure my sql server 2008 to send email notification and I tested successfully
By creating profile and account.
2 - From SQL server surface area configuration manager I did enabling Database mail stored procedure
3 - Port 25 opened
4 - I run the following scripts
sp_CONFIGURE 'show advanced', 1
GO
RECONFIGURE
GO
sp_CONFIGURE 'Database Mail XPs', 1
GO
RECONFIGURE
GO

When I test by running the following script I receive the email .
USE msdb
GO
EXEC sp_send_dbmail @profile_name='Profile1',
@recipients='mhaidar@skmc.ae',
@subject='Test message',
@body='This is the body of the test message.
Congrates Database Mail Received By you Successfully.'

5- I create operator … MAK
6 - I create backup task and I configure it to send email notification to operator MAK
My Problem That I did not receive the email when job succeed or competed or failed

I need help please
0
Comment
Question by:Haidar1
  • 6
  • 4
  • 2
12 Comments
 

Author Comment

by:Haidar1
ID: 36535178
I forget to mention ... I did restart to the SQL agent ....
0
 
LVL 10

Expert Comment

by:gaurav05
ID: 36535237
0
 
LVL 10

Accepted Solution

by:
sqlservr earned 500 total points
ID: 36535249
did you enable the mail profile in agent properties,ceck the image attached
123.JPG
0
 

Author Closing Comment

by:Haidar1
ID: 36535292
thanks a lot a spend all my day for this.


Regards
0
 

Author Comment

by:Haidar1
ID: 36540984
Hi experts
Yesterday .. I did above configuration and was successful
today change the account ... but the test failed i returen the account as before but no lcuk , can you help plesae?

I am getting the following message

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2011-09-15T09:56:19). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated).
)
0
 
LVL 10

Expert Comment

by:gaurav05
ID: 36541009
Hi,

Basically answer to this error is that mention an account name who has the rights to send an email in the Basic Authentication option .

also check with following URL
http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 10

Expert Comment

by:gaurav05
ID: 36541023

Also check this :

Use smtp.gmail.com for the server
port to 587 (Use port 587, port 465 lets you waiting)
Require secure connections checked
*Basic authentication*
username (use the full email address with @gmail.com)
password (RETYPE – the SSMS messes up the password so the autentication fails with port 587)

You may also want to read this…
(http://support.microsoft.com/kb/970315/LN/kb/968834/)
(http://support.microsoft.com/kb/968834/ )

0
 

Author Comment

by:Haidar1
ID: 36541028

Thanks for youre reply

I saw this link before ...but I dont know what shall I do I return the account as before ... but still not wroking???

I hope if you can help
0
 
LVL 10

Expert Comment

by:gaurav05
ID: 36541038
Try this.

start – programs – microsoft sql server 2008 –
configuration tool – sql server surface area configuration – surface area configuration and features

the two more things what we have to keep these things in mind while configuring database mail:

* by default port for database mail is 25.
so open that port in the firewall.

* grant permissions to relay e-mail through SMTP

start – administrative tools- Internet Information Services – expand local computer – default SMTP virtual Server Properties
- thn click tab Access thn Relay – add -
then enter IP address – click ok
0
 

Author Comment

by:Haidar1
ID: 36541063

I use in the username : username@domain.com

regarding the port 25 is opend

0
 

Author Comment

by:Haidar1
ID: 36541219
I am getting the following error

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2011-09-15T08:32:24). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated).
)
0
 
LVL 10

Expert Comment

by:sqlservr
ID: 36541889
check your sntp mail server.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now