How can I create outlook alerts with SQL?

Asked By 0 points N/A Posted on -
qa-featured

Hi,

I need your help to create outlook alerts with SQL.

How can I do it as easily as possible?

Please, narrate it step by step as I can realize it easily.

Thanks in advance

SHARE
Answered By 0 points N/A #159698

How can I create outlook alerts with SQL?

qa-featured

If we are talking about the calendar appointment, here you must to:

1. Import the outlook reference.

2. As the reference to MS office Outlook object library.

3. Right click in the Project solution and then Add reference.

4. Click on the COM tab and scroll until you find MS outlook 12.0

Click ok and enter

Step 2 // Sets up and creates an outlook calendar entry
Outlook.Application outlookApp = new Outlook.Application(); // creates new outlook app
Outlook.AppointmentItem oAppointment = (Outlook.AppointmentItem)outlookApp.CreateItem(Outlook.OlItemType.olAppointmentItem); // creates a new appointment
Step 3 // Set appointment settings
oAppointment.Subject = "Enquiry Changes made to " + name + "'s enquiry"; // set the subject
oAppointment.Body = "This is where the appointment body of the appointment is written"; // set the body
oAppointment.Location = "Nicks Desk!"; // set the location
oAppointment.Start = Convert.ToDateTime(notesDate); // Set the start date 
oAppointment.End = Convert.ToDateTime(notesDate); // End date 
oAppointment.ReminderSet = true; // Set the reminder
oAppointment.ReminderMinutesBeforeStart = 15; // reminder time
oAppointment.Importance = Outlook.OlImportance.olImportanceHigh; // appointment importance
oAppointment.BusyStatus = Outlook.OlBusyStatus.olBusy;

Step 4 // save the appointment
oAppointment.Save();

After this appointment must be added to the calendar
Step 6 // send the details in email
Outlook.MailItem mailItem = oAppointment.ForwardAsVcal(); 
// email address to send to 
mailItem.To = "mailto:[email protected]">[email protected]; 
// send 
mailItem.Send(); 

And actually here it's finished. 

Login/Register to Answer

Related Questions