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.
Author |
Topic |
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2007-11-29 : 10:42:27
|
Is anyone using a SP or Trigger to Create a HTML formated e-mail and send it useing DBmail?If so could I see a sample of the code?JimUsers <> Logic |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-11-29 : 10:52:56
|
SS2k5 only:declare @ret intEXEC @ret = msdb.dbo.sp_send_dbmail @profile_name = 'put profile name', @recipients = 'put recipients here', @subject = 'put subject here', @body = 'put html here' you can easiliy put this in a trigger since this is an async operation and does not block the trigger._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2007-11-29 : 11:17:35
|
Then there should be no problem with creating the HTML dynamically and placing in a variable. But how does it know that the body is HTML and not text?JimUsers <> Logic |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-11-29 : 11:35:41
|
@body_format = 'body_format'Is the format of the message body. The parameter is of type varchar(20), with a default of NULL. When specified, the headers of the outgoing message are set to indicate that the message body has the specified format. The parameter may contain one of the following values:TEXTHTMLDefaults to TEXT.so just add:@body_format = 'HTML'_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2007-11-29 : 11:38:18
|
Thanks Mladen Guess I will have to break down and buy a copy of ss2005.JimUsers <> Logic |
|
|
|
|
|