Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2004, 09:53 AM
Authorized User
 
Join Date: Sep 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default cannot attach file to the email

Hello friends,

can anyone tell me, how to attach a file to email using "CDONTS.Newmail" I tried several times and refered several and did the same thing as it says. but it did n't work. here is the code i used:

                set objMail = Createobject("CDONTS.NewMail")
        objMail.From = "[email protected]"
        objMail.To = recipient
        objMail.Subject = subject
        objMail.BodyFormat = cdoBodyFormatHTML
        objMail.Body = message & htmlMessage
        objMail.Importance = CdoHigh
        objMail.MailFormat = CdoMailFormatMIME
        objMail.AttachFile "C:\temp\file1.txt"
        objMail.Send

 the error is :
                error '80004005'
                 Unspecified error.

this error happens only when i use 'objMail.AttachFile "C:\temp\file1.txt" '.

please reply me soon if anybody knows about this

Thanks
joseph

 
Old September 16th, 2004, 10:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Does this file reside on the webserver or you are trying to attach that from client?

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I attach a file to an email in my .vbs file savoym VBScript 3 July 2nd, 2011 08:02 AM
attach a file and save it in the databas mary25dec Pro JSP 1 December 11th, 2006 04:10 AM
Automatically attach Excel spreadsheet to Email nbaj2k Excel VBA 3 August 1st, 2006 12:15 PM
upload, attach and send file naeemsyed Classic ASP Basics 4 March 7th, 2004 09:32 PM
Attach images to email kosla78 Classic ASP Basics 0 September 9th, 2003 03:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.