Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDONES

Status
Not open for further replies.

zzfive03

Programmer
Jun 11, 2001
267
0
0
Hello;
I need to create a web page that will allow me to send email to a client using the CDONES object.

I have it working using the values:
Mail.strFrom
Mail.strTo
Mail.strCC
Mail.strSubject
Mail.strBody

But i need to do attachemnts. I know it works by saying:
Mail.Attachment("\\filename") which will find the file via the web server. And I can do this just fine. However...

I need the user to use the:
<input type='file'>
And pick a file that will be uploaded to a particualr file on the server, and then sent as an attatchemnt. Simular to how yahoo or hotmail allow you to attach files. How would I best go about allowing a user to do this via my ASP page?

Thank you in advance for any help you can offer.
Mark
 
You may try this code:

path = &quot;directory/name&quot;

File = path & &quot;file name on server&quot;
Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
if fs.fileExists(File) then
fs.deletefile file
end if

Set SU = Server.CreateObject(&quot;aspSmartUpload.SmartUpload&quot;)
SU.Upload
If not SU.Files.Item(1).IsMissing Then
SU.Files.Item(1).SaveAs path & &quot;file name on server&quot;
End If

'* READ FILE, CHECK ERROR
File = path & &quot;file name on server&quot;

Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set thisfile = fs.OpenTextFile(file, 1, False)
 
You may try this code:

path = &quot;directory/name&quot;

File = path & &quot;file name on server&quot;
Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
if fs.fileExists(File) then
fs.deletefile file
end if

Set SU = Server.CreateObject(&quot;aspSmartUpload.SmartUpload&quot;)
SU.Upload
If not SU.Files.Item(1).IsMissing Then
SU.Files.Item(1).SaveAs path & &quot;file name on server&quot;
End If

'* READ FILE, CHECK ERROR
File = path & &quot;file name on server&quot;

Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set thisfile = fs.OpenTextFile(file, 1, False)

Hope this will help

Thanks,

Vincent.
 
You may try this code:

path = &quot;directory/name&quot;

File = path & &quot;file name on server&quot;
Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
if fs.fileExists(File) then
fs.deletefile file
end if

Set SU = Server.CreateObject(&quot;aspSmartUpload.SmartUpload&quot;)
SU.Upload
If not SU.Files.Item(1).IsMissing Then
SU.Files.Item(1).SaveAs path & &quot;file name on server&quot;
End If

'* READ FILE, CHECK ERROR
File = path & &quot;file name on server&quot;

Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set thisfile = fs.OpenTextFile(file, 1, False)

Hope this will help.

Thanks,

Vincent.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top