Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Database Mail

Author  Topic 

wlftrp
Starting Member

6 Posts

Posted - 2009-01-13 : 11:53:17
After browsing the web and reading countless articles I decided I might as well ask for some help. I'm running a system with Windows Server 2003 and Sql Server 2005 SP2. I'm trying to configure Sql Server 2005 to notify me when backup jobs fail via Database Mail. Unfortunately it has been a nightmare trying to get database mail to actually send a test mail.

Using the same smtp server, SSL enabled setting, and account name and password for the smtp server to authenticate against I have been able to send test e-mails through Outlook Express, however I cannot in database mail. Connecting to the smtp server through telnet appears to work as well, however I am stuck looking at a blank screen and charcters don't appear when I type so I haven't actually tested sending anything. I can however at least connect to the smtp server. When trying to send a test email through Database Mail I continue to receive the same error message, Cannot send mails to mail server (The operation has timed out.).

I have tested Database Mail with both the public (guest) and a private (added it to the DatabaseMailRole) account. DatabaseMailRole didn't come pre-configured in Sql Server 2005 so I added it after reading some articles. I fear however there may be more settings or configuration necessary that I am unaware of. Looking at the stored procedures it appears as though everything is accounted for.

*In case anyone asks the same questions I see everywhere else, yes Databse Mail is enabled, yes Service Broker is enabled.

I may be doing something wrong or misunderstanding how Database Mail differs from Outlook Express in sending mail, but any help would be appreciated.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-13 : 11:55:25
Which database mail are you using? xp_send_mail or db_send_mail?
Are you using 32-bit or 64-bit SQL Server?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-01-13 : 12:21:11
How did you configure Database mail? Is mail server correct?
Go to Top of Page

wlftrp
Starting Member

6 Posts

Posted - 2009-01-13 : 12:21:57
I am using 32-bit SQL Server, I'm not sure how to determine xp vs db. I am using the stored procedure call sp_send_dbmail if dbmail indicates I'm using db_send_mail then I suppose that would be the case.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-13 : 12:23:58
See http://msdn.microsoft.com/en-us/library/ms175887(SQL.90).aspx
how to configure database mail.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

wlftrp
Starting Member

6 Posts

Posted - 2009-01-13 : 12:24:40
quote:
Originally posted by sodeep

How did you configure Database mail? Is mail server correct?



I configured Database Mail both manually and through the wizard. both return the same results. I have sent e-mails in Outlook Express using the same mail settings just fine. I can also connect to the mail server via telnet. Things just fail with Database Mail.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-13 : 12:26:55
Do you get any errors?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

wlftrp
Starting Member

6 Posts

Posted - 2009-01-13 : 12:31:04
quote:
Originally posted by Peso

See http://msdn.microsoft.com/en-us/library/ms175887(SQL.90).aspx
how to configure database mail.



E 12°55'05.63"
N 56°04'39.26"




I had added the DatabaseMailRole, I had also tried using a private account that is a member of the DatabaseMailRole. Perhaps I am not doing this correctly. I'm not sure what permissions the login that is added to the DatabaseMailRole needs on the msdb database. I have left the account associated with the login public access to the msdb database. I had given it sysadmin priveledges but found that did not change anything.
Go to Top of Page

wlftrp
Starting Member

6 Posts

Posted - 2009-01-13 : 12:33:11
quote:
Originally posted by Peso

Do you get any errors?



E 12°55'05.63"
N 56°04'39.26"




The only errors I recieve is when sending the test mail, Exception Message: Cannot send mails to mail server. (The operation has timed out.)

I recieved no errors during the configuration of Database Mail nor when I had added the DatabasemailRole to msdb.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-01-13 : 13:04:31
http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/
Go to Top of Page

wlftrp
Starting Member

6 Posts

Posted - 2009-01-14 : 15:02:52
quote:
Originally posted by sodeep

http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/



Thank you, although it's a terrific walkthrough it doesn't add any information that I don't already know. I'm still having the same problem. Any other suggestions are welcome.
Go to Top of Page
   

- Advertisement -