Php Vcard shows empty on outlook

I am trying to create a vcard link download that creates the vcard on-the-fly.

if(isset($_POST)){
header("Content-type: text/vcard");
header("Content-Disposition: attachment; filename=" . get_the_title() . ".vcf");
$content = "\rBEGIN:VCARD\r";
$content .= "VERSION:2.1\r";
$content .= "N:Vicon;Barry;S.\r";
$content .= "FN:Barry S. Vicon\r";
$content .= "ORG:sample\r";
$content .= "TITLE:Partner\r";
$content .= "NOTE;ENCODING=QUOTED-PRINTABLE:    =0D=0A\r";
$content .= "TEL;WORK;VOICE:(516) 999-9999\r";
$content .= "TEL;WORK;FAX:(516) 999-9999\r";
$content .= "URL;WORK:http://www.sample.com\r";
$content .= "EMAIL;PREF;INTERNET:bcohen@sample.com\r";
$content .= "REV:TZ\r";
$content .= "END:VCARD";
echo $content;
}

the file downloads fine and the file format is correct as well but when opened in outlook, not a single info is imported.

here is the output file of the_title.vcf

BEGIN:VCARD
VERSION:2.1
N:Vicon;Barry;S.
FN:Barry S. Vicon
ORG:sample
TITLE:Partner
NOTE;ENCODING=QUOTED-PRINTABLE: =0D=0A
TEL;WORK;VOICE:(516) 999-9999
TEL;WORK;FAX:(516) 999-9999
URL;WORK:http://www.sample.com
EMAIL;PREF;INTERNET:bcohen@sample.com
REV:TZ
END:VCARD

another pre-existing vcard has the exact same info and everything seems to be working when outlook opens that file.

what am I missing here?

Answers


$content = "BEGIN:VCARD\n\r";

Solves the issue. thanks to Marc's comment


Need Your Help

Difference between TextContent and Value of an Attribute in XML

java xml attributes

Is there a difference between getTextContent() and getValue() of attributes?

Clearing the Kendo Datepicker input field from the footer

javascript jquery kendo-ui datepicker

I'm trying to put a button in my Kendo Datepicker footer that can be used to clear the input field, but the Datepicker treats any text or button in the footer as a shortcut for the current date. Does