Himmators
Himmators

Reputation: 15006

How can I allow users to add contacts to a addressbook from the browser?

We are building a webservice that allows users to send files as attachments to an e-mail-address like 'long hash'@files.example.com

We would like to allow them to add this e-mail-address to their mail-software with a nice name in a simple manner. We have two ideas for how to achieve this:

  1. Send an e-mail to them from the e-mail-address.
    • Pros: The user don't have to do anything
    • Cons: It might stick in the spam filter. Not sure if most e-mail-software adds incoming e-mail addresses to the contacts.
  2. Allow the user to click a mailto: link and send an empty mail to the e-mail-address.
    • Pros: Less risk of lack of support in e-mail software.
    • Cons: Forcing the user to do something.

Currently we're considering doing both. Does anyone have any knowledge about these approaches or maybe some other suggestion on how to achieve the same effect?

Upvotes: 0

Views: 136

Answers (1)

Toothbrush
Toothbrush

Reputation: 2141

How about a vCard?

You could use a HTML link:

<a href="data:text/vcard,BEGIN:VCARD
VERSION:2.1
N:Last name;First name
FN:Full name
ORG:Me Ltd.
TITLE:vCard Title
PHOTO;GIF:http://www.example.com/photo.gif
EMAIL;PREF;INTERNET:[email protected]
REV:20140215T212230Z
END:VCARD" download="mycard.vcf">Add us to your mailbook</a>

See http://jsfiddle.net/9jZRz/ for a demo.

Upvotes: 1

Related Questions