ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Send mail with attachment (https://www.excelbanter.com/excel-programming/281101-send-mail-attachment.html)

Jos Vens

Send mail with attachment
 
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 = "
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



Chrissy[_6_]

Send mail with attachment
 
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
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 = "
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





Jos Vens

Send mail with attachment
 
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




"Chrissy" schreef in bericht
...
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
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 = "
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







keepITcool

Send mail with attachment
 
Jos,

afaik Microsost has disabled the functionality
of the attachment part of url handling for security reasons.

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Jos Vens" wrote:


Jos Vens wrote
Hi,

I found a way with outlook to send emails with attachments.
However,



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









Jos Vens

Send mail with attachment
 
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



"keepitcool" schreef in bericht
...
Jos,

afaik Microsost has disabled the functionality
of the attachment part of url handling for security reasons.

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Jos Vens" wrote:


Jos Vens wrote
Hi,

I found a way with outlook to send emails with attachments.
However,



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












All times are GMT +1. The time now is 08:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com