Click to See Complete Forum and Search --> : Attach File to User's Email?


bryker
December 19th, 2002, 05:21 PM
[VB.NET]

I'd like a way to programmatically (1) open an instance of the user's email client, and then (2) attach to that email instance a file of my choosing--so that the user only sees a new email instance appear with a file already attached.

I have no way of knowing what the user is using as an email client, so I need code that's ready for anything.

I have this much now. No idea on how to display it to the user (so that they can fill out the To, etc.)

======start code======
Dim oMailMessage As New System.Web.Mail.MailMessage()
Dim oMailAttachment As New System.Web.Mail.MailAttachment(sMyFilePath, Web.Mail.MailEncoding.UUEncode)

With oMailMessage
.Subject = "Here's the File"
Call .Attachments.Add(oMailAttachment)
End With
======end code======

Anyone have any idea on this one?

Thanks a lot in advance.