Sending SQL Mail

Hi,

I am using SQL Server 2005. I have configured my email on Database Mail. when I am trying to send email using xp_sendmail I am getting problem error as:

Msg 17925, Level 16, State 1, Line 0

xp_startmail: failed with mail error 0x80040111

I am using following sql statement

master.dbo.xp_startmail'myaccount','mypwd'

master.dbo.xp_sendmail'tomail1@mail.co.in','test'

where myaccount and mypwd is my password on my email profile.'tomail1@mail.co.in' is the destination email address..

thanks

[1332 byte] By [Mohan1] at [2007-12-22]
# 1

Mohan,

look here [1] and here [2] for more information about that problem.

[1] http://support.microsoft.com/kb/315886/
[2] http://support.microsoft.com/kb/238119/

Seems that the logon has failed either due to wrong credentials or to insufficient priviledges.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

JensSuessmeyer at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 2
Hi Jens Suessmeyer,

Thank you for your reply.
The user I had logged on is having full privilige, both windows authentication, and sql authentication with sa user i have tried. and another thing is I am able to send database test mail. but sql mail is having problem.

And the link given by you describes the configuration on sql 2000. but my problem is in 2005.

Mohan

Mohan1 at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 3
The configuration should not matter, as this is a problem at authentication level. Look if the mail server needs an authenticated and allowed user. Otherwise the mail will not be sent and an error will be thrown. Try to write an email using telnet to see of that works.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

JensSuessmeyer at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 4

Actually the same mail server I am using for other mail engine also. My other application is able to send using same mail server that all I am doing from .net application. but using same windows user I am getting error on sqlmail.
About Telnet I didn't get clearly that sending email using it. I have heared that telnet is for remote connection.
could u plz give me some idea about mail using telnet?

Mohan

Mohan1 at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 5
Since you are using SQL server 2005, did you try sp_send_dbmail. May be that can avoid your problem.
Aego at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 6
I didn't found any sp like sp_send_dbmail in SQL Server 2005.
Mohan1 at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 7
Did you restart SQL Server Agent after configuring Database Mail?
Smitha_Expesite at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 8
Yes, I have restarted... actually i have made external mail engine... can we call that application from sql server.. like from job or any idea..?
Mohan1 at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 9

Hi,

I would first figure out why the mail engine is not working as it was set up. use the telnet commands to try sending an email with the specific account you are using for SQL Server, do something like the following:

telnet servername 25 //Which is the SMTP port<return>
helo<return>
Mail From:YourAddressyou areusing for xp_send_dbmail<return>
rcpt to:Recipient@Some@DOmain.com<return>
Data <return>
(Two returns)

HTH, Jens Suessmeyer-

http://www.sqlserver2005.de

JensSuessmeyer at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 10

Hi,
Using telnet I am able to connect my mail server. but I didn't get the proper command to send mail. actually I am not familier with telnet command to send email.

mohan

Mohan1 at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 11
sp_send_dbmail is documented in BOL. You may find how to use it and where it is by reading BOL.
Aego at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 12

Hello;

how can i send a message or q query to more than e-mail address via mssql 2005 mail server?

the address are in a table.

thank you very much.

Nesim at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...
# 13

hi,
I think you should send individual email fetching each e-mail address..

Mohan

Mohan1 at 2007-8-30 > top of Msdn Tech,SQL Server,Transact-SQL...

SQL Server

Site Classified