Results 1 to 7 of 7

Thread: Send Outlook Appointment via eMail Using PHP?

  1. #1
    Join Date
    Jan 2006
    Gloucester, MA

    Send Outlook Appointment via eMail Using PHP?

    Has anyone been able to send Outlook appointments via a PHP generated email? Not referring to the attachment you click on, but the actuall formated email that comes with the Accept, Tentative, Decline buttons at the top? I've looked everywhere on the internet and all the answers do not work or are simply trash.
    Robert D. Cluett
    Systems Engineer & Web Developer
    Verizon Communications

  2. #2
    Join Date
    May 2010

    Maybe I'm coming a bit late. I found your question yesterday while I was searching a solution to this problem. In the meantime I managed to make it work. You have to put some headers in the e-mail message and then put the meeting data in iCal format in the body of the message. Here's the function I developed :

     function sendCal($dtstart,$dtend,$loc,$summary,$from,$to,$subject) {
      $vcal = "BEGIN:VCALENDAR\r\n";
      $vcal .= "VERSION:2.0\r\n";
      $vcal .= "PRODID:-//CompanyName//ProductName//EN\r\n";
      $vcal .= "METHOD:REQUEST\r\n";
      $vcal .= "BEGIN:VEVENT\r\n";
      $vcal .= "ATTENDEE;CN=\"Attendee1Name\";ROLE=REQ-PARTICIPANT;RSVP=FALSE:MAILTO:Att1Mail@mail.com\r\n";
      $vcal .= "ATTENDEE;CN=\"Attendee2Name\";ROLE=REQ-PARTICIPANT;RSVP=FALSE:MAILTO:Att2Mail@mail.com\r\n";
      $vcal .= "UID:".date('Ymd').'T'.date('His')."-".rand()."-domain.com\r\n";
      $vcal .= "DTSTAMP:".date('Ymd').'T'.date('His')."\r\n";
      $vcal .= "DTSTART:$dtstart\r\n";
      $vcal .= "DTEND:$dtend\r\n"; 
      if ($loc != "") $vcal .= "LOCATION:$loc\r\n";
      $vcal .= "SUMMARY:$summary\r\n";
      $vcal .= "BEGIN:VALARM\r\n";
      $vcal .= "TRIGGER:-PT15M\r\n";
      $vcal .= "ACTION:DISPLAY\r\n";
      $vcal .= "DESCRIPTION:Reminder\r\n";
      $vcal .= "END:VALARM\r\n";
      $vcal .= "END:VEVENT\r\n";
      $vcal .= "END:VCALENDAR\r\n";
      $headers = "From: $from\r\nReply-To: $from"; 
      $headers .= "\r\nMIME-version: 1.0\r\nContent-Type: text/calendar; method=REQUEST; charset=\"iso-8859-1\"";
      $headers .= "\r\nContent-Transfer-Encoding: 7bit\r\nX-Mailer: Microsoft Office Outlook 12.0"; 
      mail($to, $subject, $vcal, $headers);

  3. #3
    Join Date
    Jan 2011
    There's an outlook addin available which automatically generates html-appointments. You can write your own templates to personalize them.
    Take a look up to Appointmentstyler.

    Greets Tobi

  4. #4
    Join Date
    Apr 2011
    Hi Mauron,

    I have used your code and,it's awesome i have added a one more property in that and it's working fine for me.
    $vcal .= "ORGANIZER; CN=\"Corporate\":mailto:Your@domain.com\n";

    It's work great in Thundered bird (Client email), I'm getting all the response from the sender either he accept my Meting Invitation or Deny that.
    But when I tested that in outlook everything is working Great expect that I'm unable to get the response email (either email receiver accept My request or Deny it).

    It should be like that when a receiver accept or deny my request a reponse email should be send to the sender's email.

    Please help me Thanks in Advance.

  5. #5
    Join Date
    Nov 2011

    POP3 or another problem?

    It does not work here? Is there something special when sending to a POP3?

    the only change I made to the script (see above) is
    if(mail($to, $subject, $vcal, $headers)) {
    echo("<p><center>Appointment sent!</center></p>");
    } else {
    die("Sorry but the appointment could not be sent. Please go back and try again!");
    to be able to test the result of the mail sent out.

    The mail function returns OK, but the correspondant does not receive a message. Anyone an excelent idea?

  6. #6
    Join Date
    Dec 2013

    Red face Always a newbie...

    Hi! I need a little help. Can someone give me an example of a properly formatted $dtstart and $dtend? That's all I need.
    Thanks in advance!

  7. #7
    Join Date
    Jan 2014
    I found this example of sending meeting request in Outlook it might help:

    and for more options check the reference of VCalendar : http://en.wikipedia.org/wiki/ICalendar

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center