|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, July 28, 2008 8:42 AM
Points: 302,
Visits: 271
|
|
how to send Email from sql server 2005 with Appointments to Outlook ics File
Sending Appointments to an Outlook Calendar from sql server 2005
TNX
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, July 28, 2008 8:42 AM
Points: 302,
Visits: 271
|
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Today @ 3:26 PM
Points: 31,425,
Visits: 13,738
|
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Tuesday, February 05, 2013 4:24 AM
Points: 685,
Visits: 104
|
|
my thinking is you can use the outlook programming model so you could probably use the .net runtime. create a dll which has the outlook calendar objects etc.. and add a clr udf to your server.
Everything you can imagine is real.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, July 28, 2008 8:42 AM
Points: 302,
Visits: 271
|
|
what i need is
only to generate from sql mail the file "ICS" and to send it as email attachment
can i get any help to do this
TNX
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Today @ 3:26 PM
Points: 31,425,
Visits: 13,738
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, May 26, 2011 2:20 AM
Points: 1,
Visits: 4
|
|
Here is a sample t-sql script; it uses a query to generate an attachment that has the ics format of an appointment; hope it helps
EXEC msdb.dbo.sp_send_dbmail @recipients = 'GrahameHorner@thinkpositive.com' -- ,@copy_recipients = 'copy_recipient [ ; ...n ]' -- ,@blind_copy_recipients = 'blind_copy_recipient [ ; ...n ]' -- ,@subject = 'subject' , @body = 'test' -- , @body_format = 'body_format' -- , @importance = 'importance' --- , @sensitivity = 'sensitivity' , @query = ' -- SET NOCOUNT ON; -- SELECT ''BEGIN:VCALENDAR'' + CHAR(13) + ''PRODID:-//PositiveSolutions//Extranet//EN'' + CHAR(13) + ''VERSION:1.0'' + CHAR(13) + ''METHOD:PUBLISH'' + CHAR(13) + ''BEGIN:VEVENT'' + CHAR(13) + ''CLASS:PUBLIC'' + CHAR(13) + REPLACE(''DESCRIPTION:{appointmentDescription}'',''{appointmentDescription}'',a.appointmentDescription) + CHAR(13) + REPLACE(''DTEND:{appointmentFinish}Z'',''{appointmentFinish}'',REPLACE(REPLACE(CONVERT ( varchar(19), a.appointmentFinish , 127 ), ''-'', ''''),'':'','''')) + CHAR(13) + REPLACE(''DTSTART:{appointmentStart}Z'',''{appointmentStart}'',REPLACE(REPLACE(CONVERT ( varchar(19), a.appointmentStart , 127 ), ''-'', ''''),'':'','''')) + CHAR(13) + REPLACE(''LOCATION:{appointmentLocation}'',''{appointmentLocation}'',a.appointmentLocation) + CHAR(13) + ''END:VEVENT'' + CHAR(13) + ''END:VCALENDAR'' FROM [Extranet].[dbo].[tblAppointment] a ' , @attach_query_result_as_file = 1 , @query_result_header = 0 , @query_result_separator = 'CHAR(10)+CHAR(13)' , @exclude_query_output = 1 , @query_attachment_filename = 'appointment.ics'
|
|
|
|