简体   繁体   English

CDONTS发送带有附件的电子邮件-经典ASP

[英]CDONTS sending an email with attachments - Classic ASP

I want to send an email with attachments using CDONTS. 我想用CDONTS附件发送电子邮件。 But, here is what i am using: 但是,这是我正在使用的:

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

In JavaScript we are doing: 在JavaScript中,我们正在做:

image1.src = "http://SampleWebSite.com/Sample.asp?COMMAND=6" 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. 上面的URL给我返回了图像。 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. 根据Diodeus的建议,将其嵌入HTML将导致大多数邮件客户端阻止该图像,并需要用户交互才能下载该图像。 It's better to do it attach it and reference it by CID . 最好附上它并通过CID引用它

CDO does not support HTTP. CDO不支持HTTP。 It's expecting a local file reference (C:....). 期望有本地文件引用(C:....)。

You can embed the image in the message body though, using simple HTML: 您可以使用简单的HTML将图像嵌入消息正文中:

<img src="http://SampleWebSite.com/Sample.asp?COMMAND=6" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM