Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vcard creation

Status
Not open for further replies.

swtrader

IS-IT--Management
Dec 23, 2004
182
0
0
US
I am not the resident tech person in our little company. However, I built and maintain the Access database that we use. So -- I know a bit. BUT, I know nothing about HTML or ASP.

Short question: I am trying to create a vcard that we can attach to our Outlook outgoing emails. I have used the Signature Creator in Outlook but I want to try a little more advanced approach.....specifically, among other things, I would like to have a 2 tab vcard. I've seen an email from someone who had a 2 tab vcard but I have no idea how to create it.

I copied the below from a web search....but I don't know how to run it.

Can I get some direction on how to run the code and where I might find other code snippets?

Thank you.

============

<%@LANGUAGE="VBSCRIPT"%>

<%

'<!-- Set Parameters -->

FirstName = "Bill"
LastName = "Jones"
Address = "123 Main Street"
Zip = "99999"
City = "Anytown"
Country = "USA"
Phone = "123-456-7890"
Mobile = "123-456-7890"
Email = "bill@jones.com"
Note = "Bill is a good guy."
DOB = "5/11/1972"
Sex = "male"

'<!-- Output the vCard file -->

Response.AddHeader "content-disposition", "attachment; filename=" & FirstName & " " & LastName & ".vcf"
Response.Write "BEGIN:VCARD" & vbCRLF
Response.Write "VERSION:2.1" & vbCRLF
Response.Write "N:" & LastName & ";" & FirstName & vbCRLF
Response.Write "FN:" & FirstName & " " & LastName & vbCRLF
Response.Write "Note:" & Note & vbCRLF
Response.Write "TEL;HOME;VOICE:" & Phone & vbCRLF
Response.Write "TEL;CELL;VOICE:" & Mobile & vbCRLF
Response.Write "ADR;HOME:;;" & address & ";" & city & ";;" & zip & ";" & country & vbCRLF
Response.Write "LABEL;HOME;ENCODING=QUOTED-PRINTABLE:" & address & "=0D=0A" & city & " " & zip & "=0D=0A" & Country & vbCRLF
Response.Write "X-WAB-GENDER:"
If Sex = "male" then
Response.Write "2" & vbCRLF
Else
Response.Write "1" & vbCRLF
End if
Response.Write "BDAY:" & year(date()) & Right(0 & month(DOB),2) & Right(0 & day(DOB),2) & vbCRLF
Response.Write "Email;PREF;INTERNET:" & Email & vbCRLF
Response.Write "REV:" & year(date()) & right(0 & month(date()),2) & right(0 & day(date()),2) & "T0" & right(0 & second(now()),2) & right(0 & minute(now()),2) & left(0 & second(now()),1) & "Z" & vbCRLF
Response.Write "END:VCARD"

%>
 
but I don't know how to run it
Save the code as "somefilename.asp", put it on your site and run it
 
You would need to create the vcard as a file on the server drive then attach it to the email.

Your code would create a vcard file on the client machine requesting the script.


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
So, I think you should be able to modify that script or a script like it so that it has your info, save it and request it, creating the vcard on your local machine, FTP the resulting vcf file up to the server, and attach it to an outgoing email.

You might even be able to just type the info as I don't think a vcf file is much more than

BEGIN:VCARD
VERSION:3.0
FN:gdfgdf gdfgdfg
N:dgdfgdfg;dfgdfgdfg
ORG:dfgdgdfgdfgdfg
TITLE:hjgkjghgh
ADR;WORK:;;dgdfgdfgdfg;
TEL;WORK;VOICE:56456576585
TEL;WORK;FAX:87678956568856
EMAIL;PREF;INTERNET:1@2.COM
URL;WORK:UID:
End:VCARD

I don't know how to do a 2 tab v card either.
 
The vCard format is specified in RFC 2426.


And it's simple enough to make a script that uses the File System Object (FSO) to write the entries to a text file and save it as a .vcf, then attach it to a CDOSYS generated email.

You could even script the deletion of the file after the mail message is sent

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top