Please help with SQL 2005 Database mail.

jasonpiper01
jasonpiper01 used Ask the Experts™
on
I have a Windows 2000 AD server with sql 2005. I am trying to get this database mail to work. I went through the wizard and filled in the blanks. I get these errors.
Log ID            24
Process ID            2484
Mail Item ID            10
Last Modified            5/30/2007 12:17:17 PM
Last Modified By            sa

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2007-05-30T12:17:17). Exception Message: Could not connect to mail server. (The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for)

Log ID            23
Process ID            2484
Mail Item ID            11
Last Modified            5/30/2007 12:17:17 PM
Last Modified By            sa

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2007-05-30T12:17:17). Exception Message: Could not connect to mail server. (No such host is known).
)



The name is spelled correctly, I dont know what to do.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Everything seems to point to a name resolution problem. Did you use the fully qualified domain name of the mail server? Can you ping using the name you provided - does ping resolve the name to an IP address.
Donnie4572IT Manager

Commented:
So it sounds like you are trying to relay mail through a mail server from an sql server?
If yes, you should verify that your sql server has permission to relay.

You can test this by telnet

open a command prompt on the sql server

telnet mailServerName.domain.com 25

Author

Commented:
I do have the ablilty to telnet the email server, and use the ehlo command, I did config the server name to reflect the fqdn of the mail server, this was my error message

Log ID            28
Process ID            3424
Mail Item ID            12
Last Modified            5/30/2007 1:55:01 PM
Last Modified By            sa

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2007-05-30T13:55:00). Exception Message: Could not connect to mail server. (No such host is known).
)
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Donnie4572IT Manager

Commented:
What mailserver do you have? exchange?
Can you try telnet to sending mail through the server to an external recipient using the same from address that sql would use?
http://www.windowsitpro.com/Article/ArticleID/13653/13653.html

Author

Commented:
I can not get it to verfiy the user name.

Author

Commented:
This is for exchange 2003

Commented:
For me the error "No such host is known" still stands out.
The message also indicates the error occurs when sending using "Account 2".
How many accounts do you have in your Database Mail profile? Can you double-check that they all have the correct spelling where it comes to the email server name? Especially check "Account 2".

With respect to the manual testing via telnet, can you send an email message when you skip the vrfy step?
Does your SMTP server require authentication? - if so, this has to be reflected in the Account. If you don't have authentication the default "Anonymous" will do fine.
IT Manager
Commented:
Can you please verify that the IP address of the SQL server is listed as a permited to relay?

ESM
expand servername
expand protocols
choose properties of "default smtp server"
access tab
relay button
add the ip address here


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial