Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 send email fails

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2007-12-19 : 09:52:49
Can not send emails using the following code:
EXEC master.dbo.xp_sendmail
@recipients=N'me@work.com',
@user = N'sql agent mail',
@message=N'The master database is full.' ;

error is:
xp_sendmail: Invalid parameter '@user'

I have been through the Database mail configuration wizard to create an account name. I called it SQL Agent Mail
Outgoing mail server (SMTP)
Email address: my email address i.e. me@work.com
servername: mailservername
port number: 25
Authentication: windows Authentication

Please note that I can successfully send a test E-email from database mail

Thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-12-19 : 09:56:25
You asked the very same question here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=94393

Why don't you answer our follow-up questions?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-12-19 : 10:02:29
Make sure that Mail Service is configured for the same user account that governs SQLServer Service.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

jordanam
Yak Posting Veteran

62 Posts

Posted - 2007-12-19 : 10:10:28
Why are you using xp_sendmail as opposed to Database Mail procedures?

exec msdb.dbo.sp_send_dbmail
@profile
,@recipients
,@subject
,@body
Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2007-12-20 : 04:00:04
quote:
Originally posted by harsh_athalye

Make sure that Mail Service is configured for the same user account that governs SQLServer Service.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"



Is the following ok?

I have been through the Database mail configuration wizard to create an account name. I called it SQL Agent Mail
Outgoing mail server (SMTP)
Email address: my email address i.e. me@work.com
servername: mailservername
port number: 25
Authentication: windows Authentication

Please note that I can successfully send a test E-email from database mail

Thanks
Go to Top of Page

jordanam
Yak Posting Veteran

62 Posts

Posted - 2007-12-20 : 08:07:54
There are two sets of procedures sql uses for mail. SQLMail was used in SQL 2000 and prior. It requires the xp_ procs.

SQL 2K5 introduced Database Mail, which is more consistent and works more fluidly. In an effort to maintain backwards compatability, MS KEPT BOTH. You CONFIGURED Database Mail, but you are trying to use SQLMail procedures.

You can have them both working if you'd like, but right now you are closer to having Database Mail. Configuring SQLMail offers no advantages and requires additional setup.
Go to Top of Page
   

- Advertisement -