Click to See Complete Forum and Search --> : Email With Attachment


maxwell
04-13-2004, 07:15 PM
Hello,
I have created an asp application to track bugs in our software design process. The form has a field to attach a text file. The data on the form will be posted to the database and at the same time send an email to a specified recipient with the attachment. Problem. The text file is not on the site where my asp app is hosted. Any one of five people can send the email but no one knows what the text file will be until it is sent. DO I first have to upload the file to the directory where my app is hosted? I am using the built in newmail object to send the email. I hope I am making some sense with this. any help is much appreciated.
Maxwell

buntine
04-13-2004, 11:13 PM
Im not exactly sure what your saying..

If you would like to send an attachment of a file which is located on another server, your probably going to run into problems. Most servers will not allow access to the files located within it without a direct invokation.

You can, however, attach a file from the machine you are working on.

I hope i understand what you mean.

Regards,
Andrew Buntine.

maxwell
04-19-2004, 02:03 PM
Thanks Buntine,
The file that needs to be emailed is not on the server but on the computer used by the person testing the software. I would like to be able to attach to that file but when I use the following code I get, "Cannot find File"

'send email to company about new bug
EmailFrom = EmailFrom
EmailTo = EmailTo
Emailcc = Emailcc
Subject = "New Bug"
Body = "New Bug: "
Body = body & vbnewline & Description
Body = body & vbnewline & " Posted By: "
Body = body & PostedBy

Set MailObj = Server.CreateObject ("CDONTS.NewMail")
mailobj.AttachFile paneldatabase
MailObj.BodyFormat = 1
MailObj.MailFormat = 0
MailObj.Send EmailFrom, EmailTo, Subject, Body
Set MailObj = nothing
'email sent to company about new bug
Is there anything wrong with the code? Thanks for your help.
Maxwell