April 24, 2013 at 8:19 am
I am trying to get my database to send emails but I can not get it to work. From everything I have seen everything seems to be enabled. when I send a test email from database email I never get it and there is nothing in the database mail log. I am using gmail on port 587 like it shows to set it up. Any suggestions
April 24, 2013 at 8:22 am
may be you can try some telnet commands to send an email first and see if there is any ports are blocked to access the smtp server from your server.
April 24, 2013 at 9:41 am
How is that done
April 24, 2013 at 9:51 am
April 24, 2013 at 9:52 am
Damian-167372 (4/24/2013)
may be you can try some telnet commands to send an email first and see if there is any ports are blocked to access the smtp server from your server.
if it was a connectivity issue, he'd have rows in the failed mail view.
/* show failed stuff */
SELECT SEL.event_type
, SEL.log_date
, SEL.description
, SF.mailitem_id
, SF.recipients
, SF.copy_recipients
, SF.blind_copy_recipients
, SF.subject
, SF.body
, SF.sent_status
, SF.sent_date
FROM msdb.dbo.sysmail_faileditems AS SF
JOIN msdb.dbo.sysmail_event_log AS SEL
ON SF.mailitem_id = SEL.mailitem_id
there are a lot of posts here on SSC where it seems the service broker is not processing messages; and typically stopping and starting the mail service doesn't take care of it either; most of the posts find it works after a complete server restart. Sometimes it is related to the SQL startup account not having some permissions.
EXEC msdb.dbo.sysmail_stop_sp
EXEC msdb.dbo.sysmail_start_sp
SELECT * FROM msdb.dbo.sysmail_allitems;
take a look at this MSDN article with a lot of diagnostics stuff in it;
you want to see if it's in the queue waiting to go to the mail tables, or if it's already there and it's in the not sending (which could be a firewall issue)
Lowell
April 24, 2013 at 1:00 pm
I ran both of these codes and for the top one nothing showed up in the results and for the
EXEC msdb.dbo.sysmail_stop_sp
EXEC msdb.dbo.sysmail_start_sp
SELECT * FROM msdb.dbo.sysmail_allitems;
it shows everything that I have tried to send out and I have attached part of the information
April 24, 2013 at 10:01 pm
edward_hall76 (4/24/2013)
I ran both of these codes and for the top one nothing showed up in the results and for theEXEC msdb.dbo.sysmail_stop_sp
EXEC msdb.dbo.sysmail_start_sp
SELECT * FROM msdb.dbo.sysmail_allitems;
it shows everything that I have tried to send out and I have attached part of the information
What user does the SQL Server and SQL Server agent run under? You should be able to tell this from the Windows SCM (Services). Does these users have permissions to perform such a task on the server?
--------
For SQL Tips, check out my blog: http://lantztechknowledge.blogspot.com/[/url]
You can also follow my twitter account to get daily updates: @BLantz2455
April 25, 2013 at 2:12 am
is your service broker enabled in msdb
April 25, 2013 at 7:38 pm
I think so i will check when i get back to work tomorrow
April 26, 2013 at 10:15 am
service broker is enabled
April 26, 2013 at 10:22 am
sql server is network service and server agent is local system
April 26, 2013 at 10:38 am
I got it fixed changes sql server to local system and now email works.
Thanks you all for your help.
April 26, 2013 at 12:12 pm
I don't know if this helps or not. Recently I was assigned a task to configure database email in regards to reporting the results of several steps within a job. I found that even though the email log in the system database said it could not connect to server it would still send the email on the virtual environment. However on my local workstation SQL would not connect to my mail server and send the database email. As weird as it sounds I think it is related to permissions and our domain.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply