Solved

sql mail profile sql 2005

Posted on 2010-08-21
7
1,285 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
  • 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
Zoho SalesIQ

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

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

757 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

22 Experts available now in Live!

Get 1:1 Help Now