Database Mail And Transaction Rollbacks

Dec 13, 2007

Right, Here is a good one.

I have an application that wraps all of the stored procedures it executes in a transaction.

On one of the stored procedures there is an IF statment and if the conditions of that are met then a RaisError will be triggered with a severity of 16.

Before the RaisError, a number of variables are passed to another stored procedure which will create a string and email it to a user using database mail.

The problem i am having is caused by the rollback transaction of the raiserror also rolling back the actions of the email send stored procedure.

Basically i need a way of rolling back the transaction with the execption of the email that is queued.

The only way that i have found to do it is the rollback the transaction in the if statment and then begin a new transaction for the database mail, then Commit it after the SP has been executed and then begin a new transaction for the RaisError.

Here i have two options (neither of which are ideal). Firstly i could commit the RaisError transaction but doing this makes the application cry becuase the transaction count is diffrent to what it expected. The second option is to leave the transaction open and let the application close it. This works fine but i am not comfortable with this as there is the potential of leaving an open transaction.

There must be another way of doing this so any other ideas would be fantastic.

Thanks

Steve

View 3 Replies


ADVERTISEMENT

Errors And ROLLBACKs In Triggers

Nov 28, 2007

Hello,

I'm using SQL Server 2005 Express. I have this task I've been trying to solve:





Code BlockCREATE TABLE A


(
a INT UNIQUE
)
What I want to do is to create an AFTER INSERT trigger on A that inserts 2*a and 3*a for each inserted a. As the a column is UNIQUE, errors might occur. The trigger is to a) ROLLBACK the whole transaction b) if the error occurs when inserting a, then ROLLBACK insertion of 2*a and 3*a. The trigger is suppsed not to check whether 2*a or 3*a are in A already.

The first one seems easy:





Code Block

CREATE TRIGGER InsTr ON A
AFTER INSERT
AS
BEGIN
BEGIN TRY
INSERT INTO A SELECT 2 * a FROM inserted
INSERT INTO A SELECT 3 * a FROM inserted
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
END CATCH
END
GO

DELETE FROM A
GO

BEGIN TRAN
INSERT INTO A VALUES (4) -- insert 4, 8, 12
INSERT INTO A VALUES (2) -- insert 2, 4, 6
INSERT INTO A VALUES (1) -- insert 1, 2, 3
COMMIT
GO

But I can't seem to get the second right:





Code Block

DROP TRIGGER InsTr
GO

CREATE TRIGGER InsTr ON A
AFTER INSERT
AS
BEGIN
SAVE TRANSACTION Wst
BEGIN TRY
INSERT INTO A SELECT 2 * a FROM inserted
INSERT INTO A SELECT 3 * a FROM inserted
COMMIT TRANSACTION Wst
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION Wst
END CATCH
END
GO





DELETE FROM A
GO




BEGIN TRAN
INSERT INTO A VALUES (4) -- insert 4, 8, 12
INSERT INTO A VALUES (2) -- insert 2, 4, 6
INSERT INTO A VALUES (1) -- insert 1, 2, 3
COMMIT
GO


The result is that the A is missing values 1, 2. How to solve this?

View 9 Replies View Related

SMTP Database Mail Showing Error While Sending Mail

Mar 7, 2007

Lokendra writes "I have configured the Database mail profile and account in Sql Server 2005 but the mail is not sending and showing the following error message:

Error,235,The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2007-03-05T15:16:07). Exception Message: Cannot send mails to mail server. (Mailbox name not allowed. The server response was: Sorry<c/> that domain isn't in my list of allowed rcpthosts.).
),3000,90,,3/5/2007 3:16:07 PM,sa


but while in the same mail set up in previous instance of sql server 2005 the message was sending very well. After installing new instance of sql server 2005 the problem is arising.


Anybody can tell me that what I can do so that i can send mail using the SMTP databasemail account."

View 1 Replies View Related

How To Protect Errorlogs To Tables From Rollbacks

Apr 5, 2002

Hey!

This post contains the code for this thread: http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=14475

It deals with the problem how to prevent log actions in long running batch jobs from being rolled back. It was heavily inspired by Andy PopeĀ“s approach to error handling (http://www.sqlteam.com/item.asp?ItemID=2290) and in fact you will see much of his code here.

The code:

This procedure dynamically opens a second connection in parallel to the existing connection of the calling procedure using SQL-DMO. So the second connection runs without the scope of transaction of the calling procedure. So no action you take here is rolled back in case the calling proc fails. So be careful! Keeping data integrity is your job here and you could do many weird things to your database.
The procedure dynamically adds a user function that if called just would return the object token of the new DMO connection. So any piece of code in the same batch could reuse the exisiting connection.

LogConstructor
CREATE PROCEDURE LogConstructor AS

if exists (select * from sysobjects where id = object_id (N'dbo.MFF_GetLogObject')
and OBJECTPROPERTY(id, N'IsScalarFunction') = 1)
drop function dbo.MFF_GetLogObject

DECLARE @Error INT
DECLARE @ErrorMsg VARCHAR(255)
DECLARE @oSQLServer INTEGER
DECLARE @Source VARCHAR(255)
DECLARE @Return INTEGER
declare @dynsql nvarchar(3000)

-- Create the SQLServer object
EXEC @Error = sp_OACreate 'SQLDMO.SQLServer', @oSQLServer OUT
IF @Error <> 0
GOTO OA_Error

-- Set the login process to use NT Authentication
EXEC @Error = sp_OASetProperty @oSQLServer, 'LoginSecure', -1
IF @Error <> 0
GOTO OA_Error

-- Connect to server using NT Authentication
EXEC @Error = sp_OAMethod @oSQLServer, 'Connect', NULL, @@SERVERNAME
IF @Error <> 0
GOTO OA_Error

-- Verify the connection
EXEC @Error = sp_OAMethod @oSQLServer, 'VerifyConnection', @Return OUTPUT
IF @Error <> 0
GOTO OA_Error
IF @Return = 0
GOTO OA_Error

-- Create Function with server object
select @dynsql = N'CREATE Function MFF_GetLogObject () RETURNS INT AS BEGIN RETURN ' + cast(@oSQLServer as varchar) + N' END'
EXEC sp_executesql @dynsql

return


OA_Error:
-- Get the error text
EXEC sp_OAGetErrorInfo @oSQLServer, @Source OUT, @ErrorMsg OUT
SELECT
@ErrorMsg = CONVERT(CHAR(16), @Error) + ': ' + @ErrorMsg + ' (Source: ' + @Source + ')'
print @ErrorMsg
return
GO
The next procedure just drops the DMO connection and also drops the user function as the token is invalid by now. This proc should be called within the same batch as the constructor to clean things up properly.

LogDestructor

CREATE PROCEDURE MFP_LogDestructor AS

declare @lo int
select @lo = dbo.MFF_GetLogObject()
exec sp_OADestroy @lo

if exists (select * from sysobjects where id = object_id(N'dbo.MFF_GetLogObject')
and OBJECTPROPERTY(id, N'IsScalarFunction') = 1)
drop function dbo.MFF_GetLogObject
GO

View 2 Replies View Related

Database Mail With Yahoo Business Mail Server

Feb 20, 2008

Hi all....

Our company use yahoo business mail server for our corporate mails. I know that I can configure database mail with SMTP. But when I try to configure database mail account with yahoo bizmail, I cannot do that. It gets configured but when I test it it doesn't send any mails. Do I need to have any special condiguration for this. SMTP address is smtp.bizmail.yahoo.com. Also I have specified the Authentication using my user name and password. Please help

Thanks

Rajesh

View 10 Replies View Related

Help With Mail That Send Mail When Database Bakcup Fails

Sep 1, 2006

Hello

I have got a script which gives the mail to the dba mail box when database backup fails.

In the script I want to make a change so that I get the particular database name , on what ever database i implement.

Can you tell me some suggestions.

The script I am using is :



use master
go
alter PROCEDURE dbo.SendMail
@to VARCHAR(255),
@subject VARCHAR(255),
@message VARCHAR(8000)
AS
BEGIN
SET NOCOUNT ON;
DECLARE
@rv INT,
@from VARCHAR(64),
@server VARCHAR(255);
SELECT
@from = 'testsql2000@is.depaul.edu',
@server = 'smtp.depaul.edu';


select @message = @message + char(13) + Char(13) + @@servername + '-'+ db_name()+ '-' + 'Backup Status Failed' + Char(13)

EXEC @rv = dbo.xp_smtp_sendmail
@to = @to,
@from = @from,
@message = @message,
@subject = @subject,
@server = @server;
END
GO




--- After the above script is run the following should be given in the 2nd step when
--- the backup jobs are scheduled ------

exec master.dbo.sendmail
@to = 'dvaddi@depaul.edu',
@subject =' Test sqlserver 2000',
@message = '' ;




Thanks

View 4 Replies View Related

Problem With Sending Mail Via Database Mail

Mar 9, 2007

Hi every body


I want to send a simple mail using DATABASE MAIL feature in SQL SERVER 2005.

I've defined a public profile.
I've enabled Database Mail stored procedures through the Surface Area Configuration .

but   I can't send a mail with sp_send_dbmail stored procedure in 'msdb' database .


when I execute sp_send_dbmail in the Managment Studio  the message is
"Mail queued"  but the mail is not sent.

Could it be related to Service Broker?Because  the Surface Area Configuration indicates:'this inctance does not have a Service Broker endpoint'.If so, how should I make an endpoint?

here is the log file after executing sp_send_dbmail:


1)  "DatabaseMail process is started"

2)   "The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2007-03-08T00:49:29). Exception Message: Could not connect to mail server. (No connection could be made because the target machine actively refused it)."

 The DatabaseMail90.exe is triggred ,so the mail is transfered to the mail queue but  DatabaseMail90.exe couldn't give the mail to SMTP server.The promlem is what should I do to make DatabaseMail90.exe able to connect to  the server?



please help me.

POUYAN

View 21 Replies View Related

Application-controlled Transactions, Isolation Level And Commit/rollbacks

Jun 29, 2007

If application code controls all transaction processing to SQL Server, so it starts a transaction, does any commit or rollback on teh application side, how does that actually work ON SQL Server 2005... Meaning, If the app passes in a isolation level of Repeatable Read, and the database default is different, how can I see what is being used, as a DBA? Can I see any of that via Profiler? can I see when those commits/rollbacks are issued from teh application. They are not sending in "SQL" commit/rollback transaction commands. It's built-in to their architecture to control all that... How can I see what's happening on the database if these are not SQL commands for transaction handling? and how does that work, to start a transaction on the app side, and hold locks etc, on SQL Server if normal SQL Server commands are not being sent? If anyone can point me at decent references to read on that, thanks! Bruce

View 4 Replies View Related

Send Mail Task Inside Transaction?

Oct 9, 2007

Hi,

Can we include a Send Mail Task inside a transaction?
We intend to callback a sent email in case there is an error in the subsequent task, if it is possible.

Thanks and Regards,
B@ns.

View 4 Replies View Related

Database Mail & SQL Mail

Nov 6, 2007

Hi,
Can anyone please tell me the difference between Database Mail and SQL Mail.

Thanks in Advance
R.K.Nair


RKNAIR

View 1 Replies View Related

Changing Database Mail Host Database

Jan 26, 2007

Hi

I am trying to change the host database (MSDB) of Database Mail to some new database (say NewDB) and

unable to make DatabaseMail90.exe point to this new database (NewDB).

Is it possible to do this?

Thanks

Uddemarri

View 4 Replies View Related

Database Mail

Sep 13, 2006

HI,when configuring database mail in sql server 2005 i am getting the below error.The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 4 (2006-09-13T13:50:18). Exception Message: Could not connect to mail server. (An established connection was aborted by the software in your host machine). )when i ping the smtp server, i could successfully connect to the smtp server. but when i send a test email i am getting the above error message saying not able to connect to the server.please help

View 2 Replies View Related

Database Mail

Aug 22, 2007

Hello,

I am trying to use database mail to send out a list of data. I am using a number of queries to build a string and each query needs to have its results displayed on a new line when the email is viewed using Outlook.

I am having trouble adding a line break into the string. Any pointers would be great.

Thanks Alot

Steve

View 2 Replies View Related

Database Mail

Apr 9, 2008

What is equavalent in oracle database which does the job similar to Database Mail in sql server.

i use database mail in sql server to send mail.

I do have jobs set, which gets fired every ten minutes. it uses msdb.dbo.sp_send_dbmail

and i have a profile created under database mail which has all the info related to the smtp email acct.

our client now wants our project to also work on oracle.

Thank you very much for the information.

View 1 Replies View Related

Database Mail

May 2, 2008

hi,
In database mail,
while execting sp_send_dbmail i want foolowing thing to be done.

@recipient=select emaild from <tablename>

Is it possible ?

View 2 Replies View Related

Database Mail

May 26, 2008

Please Concentrate on colored TSQL;
I should i pass dynamic text to database mail in @body.
Declare @charstrn varchar(20);
Declare @C_name varchar(20);
Declare @l_code nvarchar(20);
SET @charstrn = @S_name+'Welcome to India.You are now registered Student under counslerName'+@C_name+'BranchOffice'+@l_code;

EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'Pradeepvarun',
@recipients = @emailid ,
@body = (select @charstrn),
@subject = 'You are now Registered in APT';

View 1 Replies View Related

Database Mail

Jun 6, 2008

Hi All,

I am going made here. I set up database mail on a 2005 box. It was working fine, untill I needed to reboot it. Now it does not.

If I run a test with 2000 it works fine. However 2005 does not.

I go to the test mail bit and it says its sent, but it never turns up. So I ran:-

SELECT * FROM msdb.dbo.sysmail_event_log

And I get the fowwloing error:-

259error2008-06-06 16:38:24.493Could not retrieve item from the queue.5708NULLNULL2008-06-06 16:38:24.493UK_domainUSER


Any ideas at all would be gratfull aprisiated!!!

Thanks

Dave


Dave Dunckley says there is a law for the rich and a law for the poor and a law for
Dirty Davey.

View 8 Replies View Related

Database Mail.

Mar 19, 2007

I have an application which allows communication through an internal blog. We have to monitor all communications for compliance but I'm unable to find a solution to my problem and hope someone can help.

The application allows IM/Email/Blog entries to authenticated members. We can take these communications and send them to our exchange server. However the FROM address is always the profile owner setup in SQL.

Question:

I want the FROM address to list the person starting the conversation and not setup individual profiles for each person using the application. We already have the ability to capture the communication through the application and send it to exchange but the FROM address doesn't reflect the person initiating the conversations.

Is this possible?

Thank you, MP

View 1 Replies View Related

Database Mail

Mar 30, 2008

Hi, i need to send emails from sql server. to configure the setting i need to open database mail configuration windows right? But i dont have database mail icon or tab under management folder. I only have archieve under server roles. Help me.. Urgent.Thanks

View 7 Replies View Related

Database Mail

Feb 2, 2007

I'm keen to use database Mail in SQL 2005. It seems to work well and save's me having to implement a queue, audit logging for sent/errored etc, as SQL2005 can take care of all of that for me.

heres the but..

Is there any way to specify the "From" email address in sp_send_dbmail I know you specify it as part of email account & profile but I want to override that.

I just wanted to be able to keep an audit of all the emails that where sent from an asp.net website and thought i could get that functionality "out of the box" with SQL 2005 and DB Mail, but with out being able to set the from: address its not going to work


Any one have a sugesstion?

Thanks

View 1 Replies View Related

Database Mail Qs

Apr 9, 2008

Dear Profetionals ,
I am new in SQL I would like to set up a Database mail but I have no Mail Server in my Domain. So, I have to use yahoo pop3 and smtp whitch are mentioned here :





Incoming Mail (POP3) Server:
plus.pop.mail.yahoo.com (Use SSL, port: 995)

Outgoing Mail (SMTP) Server:
plus.smtp.mail.yahoo.com (Use SSL, port: 465, use authentication)

Account Name/Login Name:
Your Yahoo! Mail ID (your email address without the "@yahoo.com")

Email Address:
Your Yahoo! Mail address (e.g., user@yahoo.com)

Password:
Your Yahoo! Mail password


I used my yahoo email account and plus.smtp.mail.yahoo.com port: 465 to configure the Databast Mail
But no test mail recieved , Then I tried SQL help and found this SELECT * FROM msdb.dbo.sysmail_event_log ;i used this SP and the result was :
1 information 2008-04-08 14:53:53.397 DatabaseMail process is started 1188 NULL NULL 2008-04-08 14:53:53.397 IMPSDevuser2 error 2008-04-08 14:54:11.190 The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2008-04-08T14:54:10). Exception Message: Could not connect to mail server. (No such host is known). ) 1188 1 NULL 2008-04-08 14:54:11.190 saWould you please help me find the error?

View 1 Replies View Related

Database Mail

Apr 12, 2006

I am trying to configure Database Mail on a new installation of SQL Server 2005 and the 'DatabaseMailUserRole' does not exist.

How do I add this role to the server?

View 8 Replies View Related

Database Mail

Aug 16, 2007





We have a user set up for our .net framework (webuser) with access to a database we created for our website. "webuser" needs to be able to send out emails using Databse Mail (SQL Server 2005) via a stored proc by excuting msdb.dbo.sp_send_dbmail. This stopred proc works fine when I am logged in as administrator but won't work for "webuser" and I can't seem to grant DatabaseMailUserRole to our that user either. What do I need to do?


I have bee trying to find a "how to" on setting this up but have been unsuccessful.

View 3 Replies View Related

Database Mail

Aug 9, 2006

Dear Folks,I am trying to finish my configuration of Database Mail on my sp1 build 2153 sql server. I believe to have set it up properly but i still can't get a test message through. My error message reads:
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2006-08-09T15:14:00). Exception Message: Cannot send mails to mail server. (Transaction failed. The server response was: Mail from <account email address> rejected for policy reasons.). )

Everything that needs to be enabled, i.e. service broker, SQL Server Agent properties, deafult profile in msdb table, services restarted. Is this message a result of Sql server policy or the smtp server? Is there a process in the transaction Sql server initiates that could be causing the policy violation that i need to tell the email admin about?
Thanks for your reply.
-C

View 2 Replies View Related

Database Mail

Dec 6, 2007

I'm trying to use SQL server email, I am able to use it from the administrator account, but anyone else gets the "EXECUTE permission was denied on the object 'sp_send_dbmail'. The MSDN says "To send Database mail, users must be a user in the msdb database and a member of the DatabaseMailUserRole database role in the msdb database. To add msdb users or groups to this role use SQL Server Management Studio or execute the following statement for the user or role that needs to send Database Mail." . The only problem is - I have no idea what the user name / role database is. I've plunked around the MSDB database and I can't find any documentation, help, anything. I know the login name of the user I want to enable to use database mail, but obviously that's not what the bit of SQL code that MS provided is looking for. Is there an "AddMember" function somewhere?? I don't see it. Should it really be this complicated to do simple email tasks - am I looking in the wrong place?

View 6 Replies View Related

Database Mail

Oct 3, 2007



Hi,

I have setup a stored procedure which sends an email. It is working fine and I am also receiving all the emails. But, when I checked the Database Mail log in SQL Server, there are hundreds of error messages which I am not able to decide why?

Can someone please provide information on these?




Date 10/3/2007 5:31:13 AM
Log Database Mail (Database Mail Log)
Log ID 2385
Process ID 5464
Last Modified 10/3/2007 5:31:13 AM
Last Modified By MMITask_PWDXServer
Message
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.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)

View 1 Replies View Related

Error 8525: Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.

May 31, 2008

Hi All

I'm getting this when executing the code below. Going from W2K/SQL2k SP4 to XP/SQL2k SP4 over a dial-up link.

If I take away the begin tran and commit it works, but of course, if one statement fails I want a rollback. I'm executing this from a Delphi app, but I get the same from Qry Analyser.

I've tried both with and without the Set XACT . . ., and also tried with Set Implicit_Transactions off.

set XACT_ABORT ON
Begin distributed Tran
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.TRANSACTIONMAIN
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.TRANSACTIONMAIN
set REPFLAG = 0 where REPFLAG = 1 and DONE = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.WBENTRY
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.WBENTRY
set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.FIXED
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.FIXED
set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.ALTCHARGE
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.ALTCHARGE
set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.TSAUDIT
set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.TSAUDIT
set REPFLAG = 0 where REPFLAG = 1
COMMIT TRAN


It's got me stumped, so any ideas gratefully received.Thx

View 1 Replies View Related

SQL 2005 Database Mail

Apr 7, 2008

I have configured sql 2005 to send Database mail via SMTP using a profile and account that works fine during a test send. However, when I set myself up as an opperator (with the same email as the test) and tell a job to email me upon sucess, and run the job I dont get the email.I looked at the error log, and get the error that: "an attempt was made to send an email when no email session has been established"Any help is greatly appreciated!Dan

View 2 Replies View Related

Database Mail Timeouts

Feb 29, 2008

I'm having a problem with SQL Server 2005 not being able to send all of my messages. Occasionally when we batch a large number of messages together, we run into problems because the SMTP server can't process them fast enough, and the message doesn't send due to a timeout. I know I have increase the number of retries, but I'd rather just increase the timeout setting. Does anyone know where I might be able to do this at? The mail admins are also looking at modifying the rules in SMTP so that messages from these servers don't go through the vigor of SPAM and phishing detection. Hopefully that will speed it up, but I'd like to give it a little extra leniency on the SQL side as well. Any suggestions?

View 3 Replies View Related

Database Mail Problem

Jun 11, 2007

HI,

I am seeking help on sql 2005 database mail.

I just installed a new sql 2005 with sp2 on a windows 2003 sp1. I enable the database mail in surface area configuration and configured the database mail, but I got a error message when I tried to send a test mail, I used the sql server and sql server agent startup account to set up the mail.

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2007-06-11T20:17:57). Exception Message: Could not connect to mail server. (No connection could be made because the target machine actively refused it).
)

thanks.

View 2 Replies View Related

Database Mail Not Working

Jun 26, 2007

Hi
I have set up database mail.
I know the settings are correct because I use the same ones for MS Outlook on the same machine.
I am getting the following error.
-----------------------------------
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 6 (2007-06-26T06:25:01). Exception Message: Could not connect to mail server. (No such host is known). )
------------------------------------
Service broker is enabled.
Database mail is started.

i really don't know what else it could be.
...Does SQL Server Agent have anything to do with Database mail?
Any other suggestions gratefully accepted..
ICW

View 8 Replies View Related

Database Mail Error

Sep 13, 2007

Ive created an Account and a Profile using Configure Database Mail Wizard.

Ive tried to send an email using this account, but I get this error


The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2007-09-13T17:05:09). Exception Message: Cannot send mails to mail server. (Server does not support secure connections.). )


Can anyone help?

Regards

Steve


Steve Fouracre

View 2 Replies View Related

SQL 2005, Database Mail

Jan 24, 2008

I recently got the datamail setup and running. I am able to use database test mail to successfully send a test email relay through the SMTP port of the exchange server and then out to the appropriate email adress.

When i use the SP_Send_Dbmail it says Mail Queue. I check the sysmail_allitems it says the Sent_Status is sent but I never receive it.

Everything below executes just fine and places the right information in the right msdb tables. I just never receive the email. Any suggestions on where to look? Service_broker messages is enabled and i restart sqlserveragent also.

use msdb
go

exec msdb..sysmail_start_sp
go

EXEC msdb..sp_send_dbmail
@profile_name = 'DBuser'
@recipients = 'user@yahoo.com',
@subject = 'Test',
@body = 'Test',
@body_format = 'HTML'

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved