/    Sign up×
Community /Pin to ProfileBookmark

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.

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@mauronMay 12.2010 — Hi,

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 :

[CODE] function sendCal($dtstart,$dtend,$loc,$summary,$from,$to,$subject) {
$vcal = "BEGIN:VCALENDARrn";
$vcal .= "VERSION:2.0rn";
$vcal .= "PRODID:-//CompanyName//ProductName//ENrn";
$vcal .= "METHOD:REQUESTrn";
$vcal .= "BEGIN:VEVENTrn";
$vcal .= "ATTENDEE;CN="Attendee1Name";ROLE=REQ-PARTICIPANT;RSVP=FALSE:MAILTO:[email protected]";
$vcal .= "ATTENDEE;CN="Attendee2Name";ROLE=REQ-PARTICIPANT;RSVP=FALSE:MAILTO:[email protected]";
$vcal .= "UID:".date('Ymd').'T'.date('His')."-".rand()."-domain.comrn";
$vcal .= "DTSTAMP:".date('Ymd').'T'.date('His')."rn";
$vcal .= "DTSTART:$dtstartrn";
$vcal .= "DTEND:$dtendrn";
if ($loc != "") $vcal .= "LOCATION:$locrn";
$vcal .= "SUMMARY:$summaryrn";
$vcal .= "BEGIN:VALARMrn";
$vcal .= "TRIGGER:-PT15Mrn";
$vcal .= "ACTION:DISPLAYrn";
$vcal .= "DESCRIPTION:Reminderrn";
$vcal .= "END:VALARMrn";
$vcal .= "END:VEVENTrn";
$vcal .= "END:VCALENDARrn";

$headers = "From: $fromrnReply-To: $from";
$headers .= "rnMIME-version: 1.0rnContent-Type: text/calendar; method=REQUEST; charset="iso-8859-1"";
$headers .= "rnContent-Transfer-Encoding: 7bitrnX-Mailer: Microsoft Office Outlook 12.0";

mail($to, $subject, $vcal, $headers);
}[/CODE]


Cheers

Fred
Copy linkTweet thisAlerts:
@TobiJan 04.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
Copy linkTweet thisAlerts:
@abhi123Apr 20.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:[email protected]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.

[U] 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).[/U]

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.
Copy linkTweet thisAlerts:
@ofiserNov 01.2011 — 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!");

} [/QUOTE]

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?
Copy linkTweet thisAlerts:
@tandelafDec 23.2013 — 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!
Copy linkTweet thisAlerts:
@kukuJan 28.2014 — I found this example of sending meeting request in Outlook it might help:

http://arturito.net/2014/01/27/create-outlook-meeting-request-php/

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

Success!

Help @cluettr spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...