Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: CDO Doesn't support method AttachFile


Message #1 by "Matt Pfingsten" <jeditoren@h...> on Tue, 4 Sep 2001 18:44:33
I have read at least half a dozen tutorials on  sending attachments with

CDONTS. The code goes something like:



<%

  Option Explicit



  Dim objMail

  Set objMail = Server.CreateObject("CDONTS.NewMail")



  objMail.From = "friend@s..."

  objMail.Subject = "A message TO you"

  objMail.AttachFile("d:\images\pic.gif")

  objMail.To = "someone@s..."

  objMail.Body = "This is the body of the Message"

  objMail.Send



  Response.write("Mail was Sent")



  'You should always do this with CDONTS.

  set objMail = nothing

%>



I have tried running it on two servers, mine here which is a Win2kPro box

with a default installation of IIS5 and on 7host.com, a free ASP hosting

server that gives u 50MB and is hosted on Win2k Server.



It always returns this error:



Microsoft VBScript runtime  error '800a01b6'



Object doesn't support this property or method: 'AttachFile'



/jeditoren/joinsub.asp, line 17



I have succuessfully generated HTML mail and sent it all over the place

using CDONTS but the AttachFile method doesn't seem to be working.
Message #2 by "Siegfried Weber" <sweber@c...> on Wed, 5 Sep 2001 21:13:34 +0200
Try:



objMail.AttachFile "d:\images\pic.gif"



<Siegfried />



> -----Original Message-----

> From: Matt Pfingsten [mailto:jeditoren@h...]

> Sent: Tuesday, September 04, 2001 8:45 PM

> To: ASP CDO

> Subject: [asp_cdo] CDO Doesn't support method AttachFile

>

> I have read at least half a dozen tutorials on  sending attachments

with

> CDONTS. The code goes something like:

>

> <%

>   Option Explicit

>

>   Dim objMail

>   Set objMail =3D Server.CreateObject("CDONTS.NewMail")

>

>   objMail.From =3D "friend@s..."

>   objMail.Subject =3D "A message TO you"

>   objMail.AttachFile("d:\images\pic.gif")

>   objMail.To =3D "someone@s..."

>   objMail.Body =3D "This is the body of the Message"

>   objMail.Send

>

>   Response.write("Mail was Sent")

>

>   'You should always do this with CDONTS.

>   set objMail =3D nothing

> %>

>

> I have tried running it on two servers, mine here which is a Win2kPro

box

> with a default installation of IIS5 and on 7host.com, a free ASP

hosting

> server that gives u 50MB and is hosted on Win2k Server.

>

> It always returns this error:

>

> Microsoft VBScript runtime  error '800a01b6'

>

> Object doesn't support this property or method: 'AttachFile'

>

> /jeditoren/joinsub.asp, line 17

>

> I have succuessfully generated HTML mail and sent it all over the

place

> using CDONTS but the AttachFile method doesn't seem to be working.
Message #3 by bhu palan <bpl50@y...> on Wed, 5 Sep 2001 23:00:46 -0700 (PDT)
Dear Masters,

  Can U help in giving a solution to findout how to

get the number of new mails arrived in the mail inbox

using CDONTS component.

  I will appreciate if anyone could come forward at an

earliest date to help me out.



Thanking U,



Regards,

Bhupalan




  Return to Index