add an attachment to an expression mailto

T

toufik

Hi,
How can we add an attachment to an email using mailto,
I've this code to open a new email window (default email), it works but I
like to add an attachment to it

Dim mailMess As String = "mailto:" & ReplaceSpecialCharacters(mailTo)
mailMess = mailMess & "?Subject=" &
ReplaceSpecialCharacters(mailSubject)
mailMess = mailMess & "&Body=" & ReplaceSpecialCharacters(mailText)
System.Diagnostics.Process.Start(mailMess)

I've tried this but doesn't work...
mailMess = mailMess & "&Attach='" & ReplaceSpecialCharacters(attachement) &
"'"
 
C

Cor Ligthert

Hi Toufik,

With the default mailclient you cannot add attachments.

When you use by instance smtp mail (system.web.mail) or (Office) Outlook it
is possible.

I hope this helps?

Cor
 
H

Herfried K. Wagner [MVP]

* "toufik said:
Hi,
How can we add an attachment to an email using mailto,
I've this code to open a new email window (default email), it works but I
like to add an attachment to it

Dim mailMess As String = "mailto:" & ReplaceSpecialCharacters(mailTo)
mailMess = mailMess & "?Subject=" &
ReplaceSpecialCharacters(mailSubject)
mailMess = mailMess & "&Body=" & ReplaceSpecialCharacters(mailText)
System.Diagnostics.Process.Start(mailMess)

I've tried this but doesn't work...
mailMess = mailMess & "&Attach='" & ReplaceSpecialCharacters(attachement) &
"'"

It depends on what newsreader you are using. Some newsreaders expect
'&att', some don't support it at all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top