Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-14
12
Medium Priority
?
611 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:
Ramesh Babu Vavilla earned 2000 total points
ID: 36535249
did you enable the mail profile in agent properties,ceck the image attached
123.JPG
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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
 
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:Ramesh Babu Vavilla
ID: 36541889
check your sntp mail server.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
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.

722 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