Having trouble setting up Database Mail

  • I've never setup Database Mail before, so I am a newbie at this. I've enabled Database Mail through SQL Server Service Area Configuration. Then I defined a profile using the Database Mail wizard. (By the way, this is one question which I've got about the profile name. My name has embedded white space, like "SQL Mail". Is that OK, or is it a requirement that the profile have no embedded white space?)

    Next I went to set up the email address, which is a new one with the university I work for. The SMTP settings don't use the default port 25, but I've made sure I'm using the correct port number and am using SSL. Then I went to test it, and I get this error:

    Message

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2008-11-25T09:20:43). Exception Message: Cannot send mails to mail server. (The operation has timed out.).)

    I referenced this SQL Tip to help me set this up, so I'm not sure what's wrong. I've done a search and found an article on MSDN saying that perhaps the email account's inbox was full. I've logged into the account and checked it, and it had only 1 email message in its inbox, and that was quite small, so that isn't the problem.

    So, what's wrong?

    Kindest Regards, Rod Connect with me on LinkedIn.

  • I forgot to mention that I'm also using basic authentication instead of Windows authentication for the SMTP authentication, since it is reaching a SMTP server that isn't a part of our network (its the university's SMTP server; we don't have anything like MS Exchange running here).

    Kindest Regards, Rod Connect with me on LinkedIn.

  • The part in the error message about a timeout makes me wonder if it's a network issue as opposed to an authentication issue.

    Have you tried sending e-mail through that same account, from the server, using a different program (not SQL)?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • No, I haven't tried sending an email from that server using some other program. That is an interesting idea. I'll see what I can do to make that happen.

    Kindest Regards, Rod Connect with me on LinkedIn.

  • I wrote a quick .NET app to test it from my PC, and discovered that I'm getting the same error here as well. Very odd, as I can use MS Outlook fine from my own machine.

    So, I'm contacting the network admin to see what might be going on.

    Kindest Regards, Rod Connect with me on LinkedIn.

  • I've contacted my network administrator and talked to him about it. He said that it might be possible the firewall is blocking SMTP traffic, so he's going to look into it.

    However, he also said that he would, "... prefer SQL Server use (the university's) mail servers to send the mail as opposed to having the server send them via SMTP". As far as I understand it, SQL Server's Database Mail does use the mail server you specify. Am I correct about this? Or does SQL Server's Database Mail acts as its own SMTP mail server?

    Kindest Regards, Rod Connect with me on LinkedIn.

  • i had the same error few days back..i wasnt able to configure at port 25 for some reasons..i used port 26 and it worked fine..but we do have a exchange server....so u might want to try using port 26 ..changing the port no will not have any effect on the prod box (my team lead told me)..i would say first change to 26..send a test mail and den confirm it.

  • I'm using the port that the university says I need to use for outward bound SMTP traffic, and they don't use port 25 (or 26). Although I could get it a try, just to see if it would work.

    Kindest Regards, Rod Connect with me on LinkedIn.

  • Well, iqtedar, you put me on the right track. The university said that I had to use port 465, but I decided to use port 25 instead, and it worked! (After I ran it from the server, rather than running it from my machine in SSMS.)

    Kindest Regards, Rod Connect with me on LinkedIn.

  • kool...

  • Dear rod

    when you add this topic then u have mentioned already that u are using SSL and SMTP uses SSL at 465 as Gmail.com uses.

    Just for knowledge

    Thanx

    Thanks

  • Rod at work (11/26/2008)


    I've contacted my network administrator and talked to him about it. He said that it might be possible the firewall is blocking SMTP traffic, so he's going to look into it.

    However, he also said that he would, "... prefer SQL Server use (the university's) mail servers to send the mail as opposed to having the server send them via SMTP". As far as I understand it, SQL Server's Database Mail does use the mail server you specify. Am I correct about this? Or does SQL Server's Database Mail acts as its own SMTP mail server?

    Glad you got it solved.

    On the question, SQL DB Mail does not use its own SMTP. It uses the mail server you specify.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply