vCard PHP
Posted March 1st, 2004 @ 08:15pm by Erik J. Barzeski
Awhile ago I helped Judi with a vCard/PHP problem. Someone requested the source code, so here it is as a web app (the email goes nowhere, so don't send use this) and as source code.
The trick is a very simple one: vCards are just plain text with some specialized formatting. I've used this same trick to send files as ".xls" files. You can't format the text, but double-clicking the tab-delimited .xls attachments opens them in Excel.
Use this or any modification as you see fit. Please give credit where credit is due.

Donate Life
Posted 24 Mar 2004 at 6:59pm #
Here's what I need to do daily: Look up data in a MySQL database.Insert that data into an Excel template.Email the Excel template. I can send a .xls file via email, but only the kind you can create by tab-delimiting...
Posted 14 May 2004 at 10:30am #
Comments are good
Posted 16 Jun 2004 at 7:47am #
I loaded vCard PHP and get the following error;
http://www.sdalcorn.com/<?=$PHP_SELF;?>
Not Found
The requested URL /< was not found on this server.
Apache/2.0.48 (Unix) DAV/2 PHP/4.3.4 Server at http://www.sdalcorn.com Port 80
Posted 06 Jul 2004 at 6:13pm #
Sean,
Try <?php echo $_SERVER['PHP_SELF']; ?>. The $PHP_SELF variable does not work on newer versions of PHP in some configurations -- I believe this is when the 'register_globals' option is off.
Posted 04 Nov 2004 at 4:24pm #
Cool, Just the script I've been looking for!
I'm a PHP newb.. so pls bare with me :/
Ok, so I've managed to get everything working exept that the script doesn't actually send out an email.
(or at the very least I have'nt revieved one yet)
What am I going wrong?
Posted 04 Nov 2004 at 4:39pm #
Pls forgive me, I'm such a dummy!
I did get the email w/ attached vCard... It was caught up in my spam filter
FYI - I've noticed that I get an error when importing the vCard into a contact management software. I've tried changing the version variable (VERSION:3.0) to VERSION:2.1 and it seems to be working now! Any thoughts on why this error could have occurred? .. what are the differences between vCard vers. 2.1 and 3.0?
Much appreciated
Posted 12 Jan 2005 at 11:01pm #
It nearly works for me. Instead of getting a .vcf file I get a .dat file. If I save it to my desktop as a vcf then it works. Makes for a lotta work if i get quite a few emails tho... Any idea what's happening? Do you thin perhaps my server is stripping the file?
Posted 12 Sep 2005 at 6:02am #
where to set register_globe?