views:

111

answers:

1

Hi,

I have an application that can display some contact information and I want to offer the possibility to export a contact by sending an email with the contact data in an attached vCard file. The user should get a pre-composed email with the attached vCard file that opens in the default email client so that he can then choose the recipients, possibly edit the message and send it.

I have found that it is possible to something like that with a mailto: "link":

System.Diagnostics.Process.Start("mailto:[email protected]?subject=The Subject", null);

However, this does not allow attaching files.

I have found another sample where it is possible to attach a file (although the file must be first saved to disk, I would rather just keep it in RAM).

EmailMessage email = new EmailMessage();
email.To.Add(new Recipient("Name", "[email protected]"));
email.Subject = "Subject";
email.BodyText = "Text";
email.Attachments.Add(new Attachment("file.vcf"));

But now, how do I open this in the default email client? Do I have to build an interface to edit and send the message myself? In that case I would need some guidance on how to access the contacts list to add recipients to the email message.

Best Regards, Will

A: 

I would like to know too. Did you resolve it?

Hi,This is currently "on hold". But right now, I just send the contact information in the email itself, not as a vcard. So I still don't have a solution for this.Regards,Will
Will