Solved

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

Posted on 2011-09-14
12
604 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 500 total points
ID: 36535249
did you enable the mail profile in agent properties,ceck the image attached
123.JPG
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

630 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