SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


database mail sending error


database mail sending error

Author
Message
raj acharya
raj acharya
Old Hand
Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)

Group: General Forum Members
Points: 343 Visits: 401
hi,


i am getting following error

Msg 14641, Level 16, State 1, Procedure sp_send_dbmail, Line 81
Mail not queued. Database Mail is stopped. Use sysmail_start_sp to start Database Mail.


as per this i did exec sysmail_start_sp

that time it's show me status started but when again i start to send it's showing me same error again


any one has any suggestion or solution then let me know asap

Raj Acharya
dba_pkashyap
dba_pkashyap
Old Hand
Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)

Group: General Forum Members
Points: 340 Visits: 317
Was it working fine earlier?
Try sending a test mail and see the log for what's happening?

If the test mail is fine:
Go to SQL Agent Properties-->Alert System-->Enable Database Mail.
Restart the SQL Agent.

If the test mail is throwing an issue:
Check with the network adminstrators if SMTP service is running fine and is it allowing the mails (sort of).

Regards,
Pavan.
raj acharya
raj acharya
Old Hand
Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)

Group: General Forum Members
Points: 343 Visits: 401
you don't get my point previously it was working fine

let me tell you step by step

for testing purpose i am executing like below

EXEC msdb..sp_send_dbmail
@profile_name = 'profilename'
,@recipients = 'test@vcmpartners.com'
,@subject = 'test mail'
,@body_format = 'HTML'
,@body = 'test mail'
,@from_address = 'prod@vcmpartners.com'



it's show me error

Msg 14641, Level 16, State 1, Procedure sp_send_dbmail, Line 81
Mail not queued. Database Mail is stopped. Use sysmail_start_sp to start Database Mail.


as per error suggest

EXEC msdb.dbo.sysmail_start_sp; ----- to start database mail

also check status through

EXEC msdb.dbo.sysmail_help_status_sp;

it's shows me started

after that if i try to send it's show me

mail queued


but i don't get any mail

again if i start to send test mail it's shows me same error and what's it's relation to sql agent mail enable or disable

Raj Acharya
Jack Corbett
  Jack Corbett
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18380 Visits: 14893
I have written a couple of blog posts about problems with database mail that may help. You can read them here and here.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
dba_pkashyap
dba_pkashyap
Old Hand
Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)

Group: General Forum Members
Points: 340 Visits: 317
Hey Raj,

I had a similar issue, even my test mail was failing and it was giving similar sort of error.
While setting the db mail, in the SMTP server, I used the loopback address 127.0.0.1./ it can be even your IP address.(Anonymous authentication)

Even my test mail was failing, then I went to IIS Manager, select the Default SMTP server, and under General tab set the IP address as ALL Assigned.
Try this and see if it works.

Cheers,
Pavan.
raj acharya
raj acharya
Old Hand
Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)

Group: General Forum Members
Points: 343 Visits: 401
pavan,


actually here we are using exchange server so in smtp i need to put that, my problem seems different then you.

guys when i go deep into this i got one error from mail log error described as following

Exception Information =================== Exception Type: System.Data.SqlClient.SqlException
Errors: System.Data.SqlClient.SqlErrorCollection Class: 16
LineNumber: 1 Number: 6602 Procedure: sp_xml_preparedocument
Server: SQL2008 State: 2 Source: .Net SqlClient Data Provider
ErrorCode: -2146232060 Message: The error description is 'Whitespace is not allowed at this location.'.
Data: System.Collections.ListDictionaryInternal
TargetSite: Void OnError(System.Data.SqlClient.SqlException, Boolean)
HelpLink: NULL
StackTrace Information ===================


i am going to concentrate on this 'Whitespace is not allowed at this location.'

i think this is something which making problem

whatever thanx for your reply pavan i am also trying to find my solution.

Raj Acharya
James Varghese
James Varghese
SSC Veteran
SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)

Group: General Forum Members
Points: 216 Visits: 288
After starting the service using sysmail_start_sp run the following script. This will solve the issue

SET NOCOUNT ON
Declare @ch uniqueidentifier;
Declare @message_type nvarchar(256);
Declare @message_body nvarchar(max);
Declare @ctr bigint;
Declare @ctr2 bigint;
While (1=1)
Begin
Receive @ch = conversation_handle, @message_type = message_type_name from ExternalMailQueue
set @ctr2 = @ctr2 + 1
set @ctr = (select count(*) from ExternalMailQueue)
if @ctr = 0
break
end

++++++++++++++++++++++++++
Allways think Positive
++++++++++++++++++++++++++
khandelwal.deep
khandelwal.deep
SSC Veteran
SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)

Group: General Forum Members
Points: 246 Visits: 279
It worked for me....Thanks for the Query James..... can you please tell us what was the reason Database mail was behaving like that.

Thanks in advance... Smile
jerminlouis
jerminlouis
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 17
Yes, its resolved my problem.
frick156
frick156
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 311
This saved my bacon as well. Now, to figure out what it actually does...

thanks!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search