[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1040
  • Last Modified:

Php script to send email with outlook reminder

hi,

I am looking for a php script which would send an email with the appointment/reminder to the outlook calendar of the recepient.

Thanks
0
Shiva-Kumar
Asked:
Shiva-Kumar
1 Solution
 
NerdsOfTechTechnology ScientistCommented:
I believe you can use iCalander and PHP to do this....

http://www.terminally-incoherent.com/blog/2008/04/14/generate-outlook-calendar-events-with-php-and-icalendar/
http://www.ietf.org/rfc/rfc2445.txt

If you want to have the ".ics" file as an "attachment" then you should create the attachment via PHP's filesystem then add it to your email generation.

=NerdsOfTech
0
 
Ray PaseurCommented:
This is excerpted from my church calendar.  Obviously untested code, since the data base lookups are not shown here, but hopefully the variable names make sense and you will get a good understanding of the moving parts.

I do not know if you have to URLencode() the event name or description - these are cleaned elsewhere in our scripts.

We do not send this via email - we just let the client click on a link to download the event directly from the web site into the outlook calendar.  But there is no reason I can think of that you could not send the x-vCalendar file as an attachment.

Best regards, ~Ray
<?php

// DATA BASE LOOKUP GETS EVENT INFORMATION ACCORDING TO THE $k VALUE

// GENERATE HEADER INFORMATION
$k = clean_integer($_GET["k"]);
$f = "NPCCEvent" . $k . ".vcs";

// FORMAT THE DATES LIKE THIS
$vcalstart = date("Ymd\THi00", strtotime($my_event_start));
$vcalend   = date("Ymd\THi00", strtotime($my_event_end));

// SEND THE HEADERS
header("Content-Type: text/x-vCalendar");
header("Content-Disposition: inline; filename=$f");

// SEND THE VCAL STRING WITH VARIABLE SUBSTITUTION FOR EVENT INFORMATION
?>
BEGIN:VCALENDAR
VERSION:1.0
PRODID:NPC Web Calendar
BEGIN:VEVENT
SUMMARY:<?php echo "$my_event_name" . PHP_EOL; ?>
DESCRIPTION;ENCODING=QUOTED-PRINTABLE: <?php echo "$my_event_description" . "=0D=0A" . PHP_EOL; ?>
DTSTART:<?php echo $vcalstart . PHP_EOL; ?>
DTEND:<?php echo $vcalend . PHP_EOL; ?>
END:VEVENT
END:VCALENDAR

Open in new window

0
 
Shiva-KumarAuthor Commented:
Thank you
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now