Discussion Locked

ASP - CDONTS mail

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How to send a file as attachment in ASP-CDONTS component?Whether it is enough to give the path of the file in the client machine or the file should be upoaded in the server.If the file shold be in server,how to upload it from the client?

4 replies

by peyison

The file to attach has to be on the server. Here's how to send it:

Set oMail = Server.CreateObject("CDONTS.Newmail")

With oMail
.To = "someone@someplace.com"
.From = "me.@here.com"
.Subject = "whatever"
.Attachfile = "C:/Docs/MyFile.DOC", "MyFile.doc"
.Send
End With

There are several ways to get a file to the server, the easiest is to use an ASP component like ASPUpload from Persits (www.persits.com). You can also use the Posting Acceptor from Microsoft - you can do a search for "Posting Acceptor" or "cpshost.dll" at www.microsoft.com for more info. Both of these require having something installed on the server (i.e. not standard ASP). www.asptoday.com has an article on how to do file uploading via only VBScript.

Let me know if you want more info.

Set oMail = Nothing

by kamalakannans

Thanks & no need of more information, I will contact,if I have further clarification about file uploading!

This discussion is closed to new replies.