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 |
|
nadavala.ravindra
Starting Member
3 Posts |
Posted - 2008-08-18 : 01:24:20
|
| hi, i am new to SQL Server.i need to send mail as HTML every friday auto matically with Content from Table Data.Right now i am sending mail through ASP.net code but it needs application runs continously.Please ignore grammer mistakesThanks in Advance.Ravindra.N |
|
|
dexter.knudson
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-08-18 : 01:37:42
|
| See xp_sendmail & SSMS -> SQL Server Agent -> Jobs |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-18 : 01:38:36
|
| Use sp_send_dbmail. For sending it every friday create a job on sql agent to call sp_send_dbmail and schedule it to process on each friday. you can use query option in sendmail to sedn query results as mail.http://www.kodyaz.com/articles/sql2005-database-mail.aspx |
 |
|
|
nadavala.ravindra
Starting Member
3 Posts |
Posted - 2008-08-18 : 02:00:00
|
| hi,Thanks for Reply. i will go through that..get back you Ravindra.N |
 |
|
|
nadavala.ravindra
Starting Member
3 Posts |
Posted - 2008-08-19 : 04:45:16
|
| hi,i wrote proc below to send mail from SQL Serverwhich will call by SQL agent ALTER PROCEDURE Usp_TestSummaryMail ASdeclare @MailText varchar(8000)begindeclare @profile_name varchar(max)declare @recipients varchar(max)declare @body_format nvarchar(255)declare @body nvarchar(max)declare @importance varchar(10)declare @sqlstr varchar(max)set @MailText='Body Text'set @sqlstr ='EXEC msdb.dbo.sp_send_dbmail @profile_name = ''ProfileName'', @recipients = ''mailid'', @body_format = ''HTML'', @subject = ''Subject'', @body='''+@MailText+''', @importance = ''High'';' exec(@sqlstr)Return Endthis procedure is executing and giving output as 'MailQueued'but mail is not going.i created account and profile.i am not getting where is problem.Thanks in AdvanceRavindra.N |
 |
|
|
|
|
|