سؤال

I want to send an email with attachments using CDONTS. But, here is what i am using:

CDO_MAIL.AttachFile "http://SampleWebSite.com/Sample.asp?COMMAND=6"

In JavaScript we are doing:

image1.src = "http://SampleWebSite.com/Sample.asp?COMMAND=6"

The problem is - I do not have the exact image name. The above URL returns me an image. Can you please let me know how to resolve this ?

Thanks

هل كانت مفيدة؟

المحلول

Diodeus is correct. However, another way to "solve" this is to download the file so you have it locally and then attach it. Embedding in the HTML, as suggested by Diodeus, will cause most mail clients to block the image and require user interaction to download the image. It's better to do it attach it and reference it by CID.

نصائح أخرى

CDO does not support HTTP. It's expecting a local file reference (C:....).

You can embed the image in the message body though, using simple HTML:

<img src="http://SampleWebSite.com/Sample.asp?COMMAND=6" />
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top