its been three days now, i spend lot of time and efforts on stackoverflow to figure it out, finally thought of posting this question, with the below code i can send email invite but in attachment form, i want inline attachment
i am able to send invite with attached .ical file with below code, but i dont want attachment, i want inline invite along with mail body,
$headers = 'Content-Type:text/calendar; Content-Disposition: inline;
charset=utf-8;
';
$headers .= "Content-Type: /text/plain;charset=\"utf-8\"
";
$attachment="
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:Asia/Kolkata
BEGIN:STANDARD
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:" . md5(uniqid(mt_rand(), true)) . "example.com
DTEND:". $dbInsertEndTime . "T" . $EndTime . "00
DTSTAMP:" . gmdate('Ymd') . 'T' . gmdate('His') . "Z
DTSTART:". $dbInsertStartDate . "T" . $StartTime . "00
SUMMARY:" . $subject . "
ORGANIZER;CN=Foobar:mailto:foobar@myemail.com
LOCATION:" . $Location . "
DESCRIPTION:" . $desc . "
TRANSP:TRANSPARENT
BEGIN:VALARM
TRIGGER:-PT30M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR";
$headers .= $attachment;
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->SMTPDebug = 0;
$mail->Host = 'xxxxxxxxxx';
$mail->Port = 25; // TCP port to connect to
$mail->Username = EMAIL; // SMTP username
$mail->Password = PASS;
$mail->setFrom(EMAIL, 'xxxx');
$ext = "@outlook.com";
$mail->addAddress($my_ID.$ext); // Add a recipient
$mail->addReplyTo(EMAIL);
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = ($subject);
$mail->addStringAttachment($attachment,'invite.ics','base64','text/calendar');
$mail->Body = "<html>
<head>
<title>Meeeting Invite</title>
<style type='text/css'>
table.example2 {background-color:transparent;border-collapse:collapse;width:100%;}
table.example2 th, table.example2 td {text-align:center;border:1px solid black;padding:5px;}
table.example2 th {background-color:AntiqueWhite;}
table.example2 td:first-child {width:15%;}
</style>
</head>
<body>
<p>Dear ". $Employee_Name. " ,<br /><br /></p>
<p>Your meeting Scheduled.<br /></p>
</body>
</html>
";