Solved

sql mail profile sql 2005

Posted on 2010-08-21
7
1,331 Views
Last Modified: 2012-05-10
i have a mail profile created when i am trying to send a test message this is the error i am getting in mail log

Exception Type: Microsoft.SqlServer.Management.SqllMail.Server.Common.BaseException Message:Could not retrieve item from the queue. reason. the list of accounts which could send this mail is empty (probably dude to use of invalid profile).

can some one help me to fix this,
0
Comment
Question by:romeiovasu
[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
  • 4
  • 2
7 Comments
 
LVL 2

Expert Comment

by:ymiossec
ID: 33491929
how did you define the profile you use to send that email ?
Give more details...
0
 

Author Comment

by:romeiovasu
ID: 33491935
i have created the profile in sql server itself.
0
 
LVL 30

Expert Comment

by:Brad Howe
ID: 33491962

DId you restart the SQL Agent after configuring the mail profile for it.

There are two mail systems, SQL Mail, run by the SQL Server database engine used to send applicaiton emails etc , and SQL Agent Mail, run by SQL Agent which uses Database Mail set up with a profile for the SQL Agent to send alerts/ notifications.

Do you have Database Mail and SQL Mail both defined to use the profile?

- Hades666
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 30

Accepted Solution

by:
Brad Howe earned 500 total points
ID: 33491970

Here is a good example on sqltips - http://www.mssqltips.com/tip.asp?tip=1100 

And here is a scripted approach.
-- Create a Database Mail profile
EXECUTE msdb.dbo.sysmail_add_profile_sp
@profile_name = 'SQL2005_Email_ProfileName',
@description = 'Notification service for SQL Server' ;

-- Create a Database Mail account
EXECUTE msdb.dbo.sysmail_add_account_sp
@account_name = 'SQL Server Notification Service',
@description = 'SQL Server Notification Service',
@email_address = 'john.doe@domain_name.com',
@replyto_address = 'john.doe@domain_name.com',
@display_name = 'SQL Server Notification Service',
@mailserver_name = 'smtpserver.domain_name.com' ;

-- Add the account to the profile
EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
@profile_name = 'SQL2005_Email_ProfileName',
@account_name = 'SQL Server Notification Service',
@sequence_number =1 ;

-- Grant access to the profile to the DBMailUsers role
EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
@profile_name = 'SQL2005_Email_ProfileName',
@principal_id = 0,
@is_default = 1 ;

SELECT * FROM msdb.dbo.sysmail_profile
SELECT * FROM msdb.dbo.sysmail_account

to test:
sp_send_dbmail [ [ @profile_name = ] 'profile_name' ]
[ , [ @recipients = ] 'recipients [ ; ...n ]' ]
[ , [ @copy_recipients = ] 'copy_recipient [ ; ...n ]' ]
[ , [ @blind_copy_recipients = ] 'blind_copy_recipient [ ; ...n ]' ]
[ , [ @subject = ] 'subject' ]
[ , [ @body = ] 'body' ]
[ , [ @body_format = ] 'body_format' ]
[ , [ @importance = ] 'importance' ]
[ , [ @sensitivity = ] 'sensitivity' ]
[ , [ @file_attachments = ] 'attachment [ ; ...n ]' ]
[ , [ @query = ] 'query' ]
[ , [ @execute_query_database = ] 'execute_query_database' ]
[ , [ @attach_query_result_as_file = ] attach_query_result_as_file ]
[ , [ @query_attachment_filename = ] query_attachment_filename ]
[ , [ @query_result_header = ] query_result_header ]
[ , [ @query_result_width = ] query_result_width ]
[ , [ @query_result_separator = ] 'query_result_separator' ]
[ , [ @exclude_query_output = ] exclude_query_output ]
[ , [ @append_query_error = ] append_query_error ]
[ , [ @query_no_truncate = ] query_no_truncate ]
[ , [ @query_result_no_padding = ] query_result_no_padding ]
[ , [ @mailitem_id = ] mailitem_id ] [ OUTPUT ]
 
Cheers,
Hades666
0
 

Author Comment

by:romeiovasu
ID: 33492070
how to configure gmail server as an smtp mail component for sql server.
0
 
LVL 30

Expert Comment

by:Brad Howe
ID: 33492171
Hi,

START \ add remove windows components and install IIS with SMTP Services.
I don't know what verion OS you have.

2003
http://msdn.microsoft.com/en-us/library/8b83ac7t.aspx 

2008
Windows 2008 Server Manager Features right-click Add Feature SMTP Server

To manage the SMTP service on Windows Server 2008, you must use Internet Information Services (IIS) 6.0 Manager. Ensure that you install IIS 6.0 Management tools in Server Manager.

Cheers,
- Hades666
0
 
LVL 30

Expert Comment

by:Brad Howe
ID: 33492175
Sorry for GMAIL, yuo can only authenticate as one person.
See this link on how to configure it. - http://www.codingbliss.com/cb/?p=38
Cheers,
Hades666
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

688 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