Send mail with attachment

J

Jos Vens

Hi,

I found a way with outlook to send emails with attachments. However, I'm
not sure that my customer has outlook installed, so I looked for an
independent code to sent a mail and I found a good solution

here's my code

Sub SendIt()

vRecipient = "(e-mail address removed)"
vSubject = "Fine"
vBody = "The mail is send"
vAttachment = "C:\Test.xls"

vMail = "mailto:" & vRecipient _
& "?subject=" & vSubject _
& "&body=" & vBody _
& "&attachment=" & vAttachment

ThisWorkbook.FollowHyperlink vMail

End Sub

Everything works fine and is mail-client indepent (it takes the default
email program) but my attachment is not added to the mail. Who can tell me
why?

Thanks
Jos Vens
 
C

Chrissy

If you mail an attachment from one mail client then it does not
matter if the receiver uses a different mail client. The mail
you send should be able to be read from their mail client.

Chrissy.


Jos Vens wrote
 
J

Jos Vens

Hi Chrissy,

of course, my problem is not which email program the receiver uses, but I'm
concerned about the email program the sender uses (see code: mailto is
program-independant). I have a program where the user clicks on a button
and then a mail should be sent to a pre-defined address with an attachment
(and this is not an excel document, otherwise I could use the
sendmail-command which is also program-independent).

Thanks anyway
Jos Vens
 
J

Jos Vens

Thanks,

this is maybe true, because a time ago, I tried this function and it worked,
but I always update my windows version, and I suppose that this will be the
reason why it doesn't work anymore. So my question stays open: does anyone
know a method to send a mail with an attachment which is independent from a
email program, like "mailto" did?

What would I like to get? The user of my excel-program must send a workbook,
but it's fairly big, so it's better to compress it first, then send it (as a
zip-file).

Can anyone help?

Jos Vens
 

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