Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


how to Sending Appointments to Outlook ics File-from sql server Email


how to Sending Appointments to Outlook ics File-from sql server Email

Author
Message
midan1
midan1
Old Hand
Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)

Group: General Forum Members
Points: 330 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



midan1
midan1
Old Hand
Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)

Group: General Forum Members
Points: 330 Visits: 271
no answer ????



Steve Jones
Steve Jones
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: Administrators
Points: 40671 Visits: 18851
You would need the format of the Appointment email and then build that in SQL Server. I don't know of a solution off hand for this.

Is it using Exchange? There was a product (Search sqlexchange) to update Exchange with data from SQL Server.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
bledu
bledu
Right there with Babe
Right there with Babe (741 reputation)Right there with Babe (741 reputation)Right there with Babe (741 reputation)Right there with Babe (741 reputation)Right there with Babe (741 reputation)Right there with Babe (741 reputation)Right there with Babe (741 reputation)Right there with Babe (741 reputation)

Group: General Forum Members
Points: 741 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.

midan1
midan1
Old Hand
Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)Old Hand (330 reputation)

Group: General Forum Members
Points: 330 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



Steve Jones
Steve Jones
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: Administrators
Points: 40671 Visits: 18851
If you need help to generate an ICS file, you probably need to go to an Exchange or .NET site dealing with mail. Once that is done, we can help with the mailing, but this isn't necessarily the best place for a programming task like that.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
GrahameHorner
GrahameHorner
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 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)
+ ''METHODTongueUBLISH''
+ CHAR(13)
+ ''BEGIN:VEVENT''
+ CHAR(13)
+ ''CLASSTongueUBLIC''
+ 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'


ADY
ADY
SSC Rookie
SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)

Group: General Forum Members
Points: 38 Visits: 25
I tried to your solution with below script. it executes successfully but no message at recipient end. Can you please me

____________________________________________________________________________

EXEC msdb.dbo.sp_send_dbmail
@recipients = 'abc@hotmail.com'
,@copy_recipients = 'xyz@hotmail.com'
,@blind_copy_recipients = 'KLM@hotmail.com'

,@subject = 'Test Meeting'
,@body = 'test by adnan'
-- , @body_format = 'body_format'
--, @importance = 'importance'
--- , @sensitivity = 'sensitivity'
, @query =
'
--
SET NOCOUNT ON;
--
SELECT ''BEGIN:VCALENDAR''
+ CHAR(13)
+ ''PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN''
+ CHAR(13)
+ ''VERSION:1.0''
+ CHAR(13)
+ ''METHODTongueUBLISH''
+ CHAR(13)
+ ''BEGIN:VEVENT''
+ CHAR(13)
+ ''CLASSTongueUBLIC''
+ 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
[tblAppointmnt] 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'
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search