Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to setup database mail in ms sql 2005. I setup but everytime I try to send a msg through their email tester it fails and I get this msg.

Date 7/7/2010 10:54:12 AM Log Database Mail (Database Mail Log)

Log ID 48 Process ID 2148 Mail Item ID 23 Last Modified 7/7/2010 10:54:12 AM Last Modified By sa

Message The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2010-07-07T10:54:11). Exception Message: Cannot send mails to mail server. (Failure sending mail.). )

I don't understand why. I am using my isp smtp and it use to work for a brief time with database mail. I even pinged my smtp server through cmd prompt and I can reach it. So I don't understand why it does not work.

I even tried my hosting company smtp and gmail smtp. I always get the same msg.

When I try the tutorial provided my Km_ I get

1) Exception Information  ===================  Exception Type: System.NullReferenceException  Message: Object reference not set to an instance of an object.  Data: System.Collections.ListDictionaryInternal  TargetSite: Microsoft.SqlServer.Management.SqlIMail.Server.Objects.Account GetAccount(Int32)  HelpLink: NULL  Source: DatabaseMailEngine    StackTrace Information  ===================     at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)     at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.SessionManager.GetAccount(Int32 accountID)     at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateSendMailCommand(DBSession dbSession)     at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateCommand(DBSession dbSession)     at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandRunner.Run(DBSession db)     at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(Object o)
share|improve this question

migrated from stackoverflow.com Jul 7 '10 at 18:15

This question came from our site for professional and enthusiast programmers.

1  
Sounds like some service got shut off (or wasn't installed)... Posting on ServerFault may help too. –  Austin Salonen Jul 7 '10 at 18:02

2 Answers 2

up vote 1 down vote accepted

Is database mail option ON? If not use this script and make sure it is on

sp_CONFIGURE 'show advanced', 1
GO
RECONFIGURE
GO
sp_CONFIGURE 'Database Mail XPs', 1
GO
RECONFIGURE
GO 
sp_CONFIGURE 'show advanced', 0
GO
RECONFIGURE
GO

Also make sure port 25 is open. If you are using gmail you may have to use port 587. check out this blog

share|improve this answer
    
hmm port 25 should be open my thunderbird has no problem sendning out emails. –  chobo2 Jul 7 '10 at 18:51

There are many reasons this kind of thing can fail. Unfortunately, the log you got isn't detailed enough to trace the exact reason for it. What I'm suspecting is the case here is that the "From:" address in the mails is not configured correctly. Most mailers require either the To: or the From: address to be in a list of local domains ('gmail.com' for instance) and won't accept mail that doesn't have this. So if your mail is coming from "Administrator@database.local" and is sending to "someone@gmail.com" but forwarding through your local ISP's mailer, the ISP's mailer will reject the message. This kind of thing can be bypassed if you can configure authenticated-SMTP.

share|improve this answer
    
Well I am tried using like my 2 gmail accounts but using my local isp. So like from: first@gmail.com to second@gmail.com –  chobo2 Jul 7 '10 at 19:11
    
I don't know if my local isp is rejecting my messages I now geto connection could be made because the target machine actively refused it IP of my isp provider. I don't get it though I tried different ports other than 25 and stil get that. –  chobo2 Jul 7 '10 at 19:58
    
Some ISPs blacklist IP addresses that throw junk at it too often. You just might have crossed that threshold in all of your testing, thus the active refusal. At this point you'll have to wait until the blacklist goes away before you can try again. –  sysadmin1138 Jul 7 '10 at 20:32
    
How long u figure that usually takes? I am also now trying my site hosting and have had a little bit of success where now I can send a database mail msg to my other accounts(from my hosting site) but if I try to send to my gmail one it dies. It says "Mailbox unavailable. The server response was: Authentication is required for relay" yet I am sure I have the right password. I copied it right from my web.config that I know works and sends email no any account no problem. –  chobo2 Jul 7 '10 at 21:11
    
I don't know I changed my password to "12345" and copied and pasted my email address into the box and it still does not work. I can't win :( –  chobo2 Jul 7 '10 at 21:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.