Highlighted
psoliveira80
Member.
115 views

Ical Appointment

How to create an appointment in recipient's inbox via iCal by firing through PHP Mailer?

$ical = '

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Novell Inc//Groupwise 18.1.0
METHOD:PUBLISH
X-WR-CALNAME:Calendário
BEGIN:VEVENT
X-GWITEM-TYPE:APPOINTMENT
SUMMARY:SNP nº 845131 dia 11/12/2019 às 14h30
DTSTART;TZID="Brasilia Standard Time":20191222T143000
DTSTAMP:20191210T193824Z
X-GWMESSAGEID:5DCB0A30.INSTITUCIONAIS.POACICSSE.200.2000085.1.BD5AC.2
LAST-MODIFIED:20191210T210317Z
TRANSP:OPAQUE
X-GWSHOW-AS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:TENTATIVE
X-GWBOX-TYPE:RECEIVED
STATUS:COMPLETED
X-GWRECORDID:5DCAE002.SERVIDORES.POASRVNE1.100.1756E69.1.9BAC.1
ORGANIZER;CN="PGR-Agendamento-CAR";ROLE=CHAIR:
MAILTO:PGR-Agendamento-CAR@mpf.mp.br
ATTENDEE;CN="PGR-Agendamento-CAR ";ROLE=REQ-PARTICIPANT:
MAILTO:PGR-Agendamento-CAR@mpf.mp.br
ATTENDEE;CN="PGR-csc-snct PGR-csc-snct";ROLE=REQ-PARTICIPANT;CUTYPE=GROUP:
MAILTO:PGR-csc-snct@mpf.mp.br
ATTENDEE;CN="PRBA-csc-snct PRBA-csc-snct";ROLE=REQ-PARTICIPANT;
CUTYPE=GROUP:MAILTO:PRBA-csc-snct@mpf.mp.br
ATTENDEE;CN="Pablo Souza Oliveira (PR.BA)";ROLE=REQ-PARTICIPANT;
PARTSTAT=COMPLETED:MAILTO:PabloSO@mpf.mp.br
DESCRIPTION: Agendada Videoconferência com gravação dia 11/12/2019 (quinta-feira) das 14h30 às 19h (horário de Brasília).
LOCATION:PRM FEIRA DE SANTANA / BAHIA
DTEND;TZID="Brasilia Standard Time":20191222T190000
COMPLETED:20191210T162605Z
UID:20191112T193824Z_938D008576E@mpf.mp.br2
PRIORITY:5
CLASS:PUBLIC
X-GWCLASS:NORMAL
END:VEVENT
END:VCALENDAR

';


$mail = new PHPMailer;

$mail->isSMTP();
$mail->Host = 'XXX';
$mail->Port = 25;
$mail->SMTPAuth = true;
$mail->Username = 'XXX';
$mail->Password = 'XXX';
$mail->setFrom('XXX', 'XXX');
$mail->addAddress($email1, $email1);
$mail->addAddress($email2, $email2);
$mail->IsHTML(FALSE);
$mail->ContentType = 'text/calendar';
$mail->addCustomHeader('MIME-version',"1.0");
$mail->addCustomHeader('Content-type',"text/calendar; method=REQUEST; charset=UTF-8");
$mail->addCustomHeader('Content-Transfer-Encoding',"7bit");
$mail->addCustomHeader("Content-class: urn:content-classes:calendarmessage");

$mail->Body = $ical;
$mail->send();

Labels (1)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.