PHPMailer - 在Thunderbird中发送事件邀请

I want to send event invitation mail for ThunderBird using PHPMailer library.

Tried below code.

$mail->isSMTP();
$mail->Host = MAIL_HOST;
$mail->SMTPAuth = MAIL_SMTPAUTH;
$mail->Username = MAIL_USERNAME;
$mail->Password = MAIL_PASSWORD;
$mail->SMTPSecure = MAIL_SMTPSECURE;
$mail->Port = MAIL_PORT;
$mail->addAddress($t);
$mail->Body  = $body;

$vcal .= "BEGIN:VCALENDAR
";
$vcal .= "VERSION:2.0
";
$vcal .= "PRODID://Foobar Corporation//NONSGML Foobar//EN
";
$vcal .= "METHOD:PUBLISH
"; // requied by Outlook
$vcal .= "X-WR-CALNAME:PH2011
";
$vcal .= "X-WR-TIMEZONE:Asia/Singapore
";
$vcal .= "BEGIN:VEVENT
";
$vcal .= "UID:".date('Ymd').'T'.date('His')."-".rand()."-example.com
"; // required by Outlok
$vcal .= "DTSTAMP:".date('Ymd').'T'.date('His')."
"; // required by Outlook
$vcal .= "DTSTART:$dtstart
";
$vcal .= "DTEND:$dtend
";
$vcal .= "SUMMARY:Your Summary Here
";
$vcal .= "LOCATION: Your Location Here
";
$vcal .= "DESCRIPTION: Your Description Here
";
$vcal .= "END:VEVENT
";
$vcal .= "END:VCALENDAR
";

$headers = "From: $from
Reply-To: $from";
$headers .= "
MIME-version: 1.0
Content-Type: text/calendar; name=calendar.ics; method=REQUEST; charset=\"iso-8859-1\"";
$headers .= "
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 12.0";

$mail->addCustomHeader($vcal);
$mail->addCustomHeader($headers);

$mail->send()

this code says mail sent successsfully, but does not actually set calender Event.

Firstly, read the PHPMailer docs; you're just using it wrong. PHPMailer has a bundled ical creation class, and there's an example of how to use it in the unit tests, though note that client support for calendar attachments is very inconsistent.