Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database mail using Gmail 2

Status
Not open for further replies.

seaport

MIS
Jan 5, 2000
923
US
I know how to set up Database Mail in SQL Server 2005. I also set up my Outlook to handle my Gmail(free) account.

However, when I set up the database mail using my gmail account (basically the same way as setting up Outlook email), I got the following error:
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 6 (2007-10-28T09:24:41). Exception Message: Cannot send mails to mail server. (The operation has timed out.)

The sql server was able to send out emails using the mail server of my ISP.

Did anyone get the same problem?

I suspect that Google does not allow people using its mail server sending out automatic emails, in order to prevent spam. Am I right?

Thanks in advance.

Seaport

 
You will need to use your ISPs mail server to send the mail. Odds are you ISP doesn't allow you to connect to SMTP servers other than theres.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Denny,

Thanks for the reply. My company's ISP is kind of strange. It gaves us T1 but no email service. That's why we are using "Gmail for Organizations."

Right now we are using the standard edition, which is free. The difference between standard edition and the paid edition is here.

Could you take a look of it and see whether the difference caused my problem?

As a temporary solution, I used a local company's mail server. However, I got a very strange problem. With the exactly same setting, the SQL server (developer edition) on my laptop can send out emails to the Internet, the SQL server (standard edition) on the Windows 2003 server could not and got the error like "Not a local host hotmail.com, not a gateway." I am pretty sure that I did not make any spelling error in setting up the database mail.

Any suggestion?

Seaport
 
I don't see anything on there about SMTP so I would assume that the free version should be fine.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Here is an update on this thread.

I have set up gmail account on the SQL server 2005 computer (Windows Server 2003). As I said before, this is a free "Gmail for Organizations" service, so the email address is not like abc @ gmail.com, but like abc @ seaport.com.

The Outlook can send out and receive email without any problem. But still, SQL server cannot send out emails.

So it is safe to say that Google must have something to do with this problem.

Denny, you suggested that using ISP's mail server to send out emails. However, since our domain name is hosted by Google (I mean all email accounts for seaport.com are using Gmail server), can I get another mail server to send out emails from SQL server? In other words, is Gmail mail server is the only choice for me?

Seaport
 
You can use any SMTP server which will allow you to relay. You could even setup an email on your network and configure that SMTP server to relay the emails. The server that you connect to, in order to send the emails has nothing to do with the server who is hosting your email services.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Thanks, Denny. That's what I have to do.

Seaport
 
Old thread -- but I get the same error. It's not the ISP, though. I have set up Outlook on my computer, and it can send emails fine. I set up SQL Mail to use the same gmail account, with the same settings, and I get Seaport's error. Same computer, same network, works with outlook, doesn't work with sql.

Has anyone solved this since? Appreciate any input.
Thanks.
 
Jenlion,

Above where they wrote, they said they needed to incorporate SMTP services on a server within their own network, and setup DBMail to work with that, which would then relay their emails through gmail.

I haven't done this personally, but it sounds like that is what worked for them.

Respectfully,

- Jim


-Ovatvvon :-Q
 
I don't believe that typically sql 2005 actually requires though, is that right? I really need a simple solution that I can replicate at customer sites quickly and easily. What I really need to know is whether this is a sql limitation or a gmail one.

thanks
 
To my knowledge, SQL Server DBMail needs to send to an SMTP server. I could be wrong. I have not verified that with any technical articles.

You can use any IIS server [windows 2000 / 2003, etc] for SMTP services. Set that up to work with gmail.

If you don't have that available, I think there are free SMTP services out there, but the emails would not be secure. Gotta choose: spend money, or settle for less performance and security. :)



-Ovatvvon :-Q
 
Yes SQL Server needs an available SMTP server to send mail to.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
I am not aware of any free SMTP service. I am going to use the service from either SMTP.com or AuthSMTP.com. It is not expensive.

However, before I do that, can I set up an internal SMTP? Basically, my SQL server sits on a Windows Server 2003, which has the software of IIS and SMTP server on it. I do not have a web server setup and the newwork does have static IP address. Is it complicated to set up the SMTP to shoot out emails?

Seaport
 
seaport,

Setting up SMTP should not be too difficult in IIS; however, I think it is generally not recommended to run IIS on the same server as SQL Server. You certainly can do it, but, because of the security holes IIS has had historically, it could be potentially bad if you have any type of sensitive information in your database.


-Ovatvvon :-Q
 
Your ISP probably provides SMTP services that you can use.

It's recommended not to run the Web site portions of IIS on a SQL Server do to the security holes. It's usually not a problem to run the SMTP portion on the same server. Just make sure that you limit the machines that can connect to the SMTP server to the localhost only.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top