|
-
Apr 27th, 2005, 03:25 PM
#1
Thread Starter
Lively Member
How do I send email with attachments??
I am needing to click a button which send some parameters to a function which opens the users default email program and creates a new message.
The code I'm using does this just fine, the only problem is I cannot figure out what the parameter would be in order to attach a file.
Here is what I am using...
VB Code:
Public Function OpenEmail(ByVal EmailAddress As String, _
Optional ByVal Subject As String = "", _
Optional ByVal Body As String = "", _
Optional ByVal Attachment As String = "") As Boolean
Dim bAnswer As Boolean = True
Dim sParams As String
sParams = EmailAddress
If LCase(Strings.Left(sParams, 7)) <> "mailto:" Then _
sParams = "mailto:" & sParams
If Subject <> "" Then _
sParams = sParams & "?subject=" & Subject
If Body <> "" Then
sParams = sParams & IIf(Subject = "", "?", "&")
sParams = sParams & "body=" & Body
'****** What is the parameter for attaching a file??
sParams = sParams & "attachment=" & Attachment
End If
Try
System.Diagnostics.Process.Start(sParams)
Catch
bAnswer = False
End Try
Return bAnswer
End Function
Could someone please help?!
Thanks
CC
-
Apr 27th, 2005, 03:33 PM
#2
Re: How do I send email with attachments??
I don't think you can attach a file that way (not reliably anyway) from what I remember adding an attachment is not part of the official mailto: syntax, which means some email apps like outlook might be able to recognize and use the parameter, while others will not...
I think automatically adding attachments is a big security risk, which is why it was never implemented as a standard
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|