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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql 2005 and mail

Status
Not open for further replies.
Jun 27, 2001
837
US
I have a sql 2005 box that a programmer is trying to get a stored proc to send email. I can send emails with the sqlexec (job fails notify sent) and that works. However their code below fails with the error on the bottom. Any ideas?

SET @SUBJECT='Test Subject'
SET @BODY='Test Body'
SET @EMAILADDRESS='awehring@cmsstl.com'
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'sqlexec@cmsstl.com',
@recipients = @EMAILADDRESS,
@body_format = 'HTML',
@body = @BODY,
@subject = @SUBJECT;


Msg 14607, Level 16, State 1, Procedure sysmail_verify_profile_sp, Line 42
profile name is not valid
 
The profile name needs to be the name of the database mail profile not the email address that you are sending from.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Thanks, I found this by looking on a server that was working
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top