Database Mail 2008 problem
-
I have configured SQL Server 2008 Enterprise --Database Mail with the SQL below. But when I try to send mails with my hotmail e-mail account, I just get the error message(
select * from msdb.dbo.sysmail_event_log;
):
Quote:
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 24 (2011-11-17T17:20:53). Exception Message: Could not connect to mail server. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.125.53.109:25)
I have tried several email account, like hotmail(smtp.live.com), QQ(smtp.qq.com), gmail(smtp.gmail.com) and 163(smtp.163.com), but what I got was the same message as above. Any help would be greatly appreciated!
-- ENABLE DATABASE MAIL FEATURE IN SYSTEM CONFIGURATION
use master
go
sp_configure 'show advanced options',1
go
reconfigure with override
go
sp_configure 'Database Mail XPs',1
go
reconfigure
go-- DECLARE DATABASE MAIL ACCOUNT PARAMETERS Declare @qmail\_account\_name as varchar(64); Declare @qmail\_account\_description as varchar(64); Declare @qmail\_account\_email\_address as varchar(64); Declare @qmail\_account\_display\_name as varchar(64); Declare @qmail\_account\_username as varchar(64); Declare @qmail\_account\_password as varchar(64); Declare @qmail\_account\_mailserver\_name as varchar(64); -- DECLARE PROFILE PARAMETERS declare @qmail\_profile\_profile\_name as varchar(64); declare @qmail\_profile\_description as varchar(64); -- DECLARE PRINCIPLES declare @qprincipal\_name as varchar(16); **\-- SET SMTP ACCOUNT DETAILS, USERNAME AND PASSWORD HERE set @qmail\_account\_mailserver\_name = 'smtp.live.com'-- SMTP Server Name set @qmail\_account\_username='hellomoney' -- SMTP User Name set @qmail\_account\_email\_address = 'hellomoney@hotmail.com' -- Email Address set @qmail\_account\_password='123' -- PASSWORD FOR SMTP User** set @qmail\_account\_name = 'TestAdministrator' set @qmail\_account\_description = 'Mail account for administrative e-mail.' set @qmail\_account\_display\_name = 'Test Automated Mailer' -- PROFILE PARAMETERS ASSIGNMENT set @qmail\_profile\_profile\_name = 'MyEmailServiceProfile' set @qmail\_profile\_description = 'Profile used for database mail jobs' --PROFILE TYPE set @qprincipal\_name= 'public' if ( @qmail\_account\_mails
-
I have configured SQL Server 2008 Enterprise --Database Mail with the SQL below. But when I try to send mails with my hotmail e-mail account, I just get the error message(
select * from msdb.dbo.sysmail_event_log;
):
Quote:
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 24 (2011-11-17T17:20:53). Exception Message: Could not connect to mail server. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.125.53.109:25)
I have tried several email account, like hotmail(smtp.live.com), QQ(smtp.qq.com), gmail(smtp.gmail.com) and 163(smtp.163.com), but what I got was the same message as above. Any help would be greatly appreciated!
-- ENABLE DATABASE MAIL FEATURE IN SYSTEM CONFIGURATION
use master
go
sp_configure 'show advanced options',1
go
reconfigure with override
go
sp_configure 'Database Mail XPs',1
go
reconfigure
go-- DECLARE DATABASE MAIL ACCOUNT PARAMETERS Declare @qmail\_account\_name as varchar(64); Declare @qmail\_account\_description as varchar(64); Declare @qmail\_account\_email\_address as varchar(64); Declare @qmail\_account\_display\_name as varchar(64); Declare @qmail\_account\_username as varchar(64); Declare @qmail\_account\_password as varchar(64); Declare @qmail\_account\_mailserver\_name as varchar(64); -- DECLARE PROFILE PARAMETERS declare @qmail\_profile\_profile\_name as varchar(64); declare @qmail\_profile\_description as varchar(64); -- DECLARE PRINCIPLES declare @qprincipal\_name as varchar(16); **\-- SET SMTP ACCOUNT DETAILS, USERNAME AND PASSWORD HERE set @qmail\_account\_mailserver\_name = 'smtp.live.com'-- SMTP Server Name set @qmail\_account\_username='hellomoney' -- SMTP User Name set @qmail\_account\_email\_address = 'hellomoney@hotmail.com' -- Email Address set @qmail\_account\_password='123' -- PASSWORD FOR SMTP User** set @qmail\_account\_name = 'TestAdministrator' set @qmail\_account\_description = 'Mail account for administrative e-mail.' set @qmail\_account\_display\_name = 'Test Automated Mailer' -- PROFILE PARAMETERS ASSIGNMENT set @qmail\_profile\_profile\_name = 'MyEmailServiceProfile' set @qmail\_profile\_description = 'Profile used for database mail jobs' --PROFILE TYPE set @qprincipal\_name= 'public' if ( @qmail\_account\_mails
Caveat I almost never use sql mail. Are you sure that you can use a public SMTP server from sql mail. It would never occur to me to try, we always use an internal server.
Never underestimate the power of human stupidity RAH