|
 |
asp_web_howto thread: attachment on CDONTS email
Message #1 by "Richard Graves" <richgraves@m...> on Wed, 18 Apr 2001 17:12:57 -0700
|
|
I am trying to send an email with an attached txt file. The file is created
fine, but then the code busts on the line where the file is attached to the
email. Everywhere I look, it says to do it the same way, but it breaks on
me.
This is the error.
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'AttachFile'
/admin/surveydump.asp, line 165
and this is the code that generates the error:
pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
Set txtfile
filesys.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INF
O")),pathEnd)&"\" & textfilename)
Set objSendMail = CreateObject("CDONTS.NewMail")
With objSendMail
.From = "rgraves@k..."
.To = aEmailaddress
.Subject = "Data retrieval you requested"
.Body = "Here is a text file of the data you requested. You may import it
into excel using a semi-colon (;) as a delimiter."
.AttachFile = txtfile (this is line 165)
.Send
End With
Does anyone know what the problem with this is?
Message #2 by "John Olival" <john@r...> on Thu, 19 Apr 2001 08:45:17 +0100
|
|
The right syntax for line 165 is
.AttachFile(txtfile, "Caption for this attachment")
hth
John
-----Original Message-----
From: Richard Graves [mailto:richgraves@m...]
Sent: 19 April 2001 01:13
To: ASP Web HowTo
Subject: [asp_web_howto] attachment on CDONTS email
I am trying to send an email with an attached txt file. The file is
created
fine, but then the code busts on the line where the file is attached to
the
email. Everywhere I look, it says to do it the same way, but it breaks
on
me.
This is the error.
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'AttachFile'
/admin/surveydump.asp, line 165
and this is the code that generates the error:
pathEnd =3D Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
Set txtfile =3D
filesys.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH
_INF
O")),pathEnd)&"\" & textfilename)
Set objSendMail =3D CreateObject("CDONTS.NewMail")
With objSendMail
.From =3D "rgraves@k..."
.To =3D aEmailaddress
.Subject =3D "Data retrieval you requested"
.Body =3D "Here is a text file of the data you requested. You may
import it
into excel using a semi-colon (;) as a delimiter."
.AttachFile =3D txtfile (this is line 165)
.Send
End With
Does anyone know what the problem with this is?
Message #3 by "Richard Graves" <richgraves@m...> on Thu, 19 Apr 2001 11:14:29 -0700
|
|
When I use this syntax, I get the following error (a search on 800a0414
produces no results on MSDN):
Microsoft VBScript compilation error '800a0414'
Cannot use parentheses when calling a Sub
/admin/surveydump.asp, line 165
.AttachFile(txtfile, "consumerdata")
-----Original Message-----
From: John Olival [mailto:john@r...]
Sent: Thursday, April 19, 2001 12:45 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
The right syntax for line 165 is
.AttachFile(txtfile, "Caption for this attachment")
hth
John
-----Original Message-----
From: Richard Graves [mailto:richgraves@m...]
Sent: 19 April 2001 01:13
To: ASP Web HowTo
Subject: [asp_web_howto] attachment on CDONTS email
I am trying to send an email with an attached txt file. The file is
created
fine, but then the code busts on the line where the file is attached to
the
email. Everywhere I look, it says to do it the same way, but it breaks
on
me.
This is the error.
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'AttachFile'
/admin/surveydump.asp, line 165
and this is the code that generates the error:
pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
Set txtfile
filesys.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH
_INF
O")),pathEnd)&"\" & textfilename)
Set objSendMail = CreateObject("CDONTS.NewMail")
With objSendMail
.From = "rgraves@k..."
.To = aEmailaddress
.Subject = "Data retrieval you requested"
.Body = "Here is a text file of the data you requested. You may
import it
into excel using a semi-colon (;) as a delimiter."
.AttachFile = txtfile (this is line 165)
.Send
End With
Does anyone know what the problem with this is?
Message #4 by Imar Spaanjaars <Imar@S...> on Thu, 19 Apr 2001 21:13:12 +0200
|
|
This simply means that you cannot use the () surrounding the arguments you
are passing.
Try this instead:
.AttachFile txtfile, "Caption for this attachment"
Make sure that txtfile contains a valid file, otherwise the method will fail.
I also found that the "Caption" does not always work correctly.
HtH
Imar
At 11:14 AM 4/19/2001 -0700, you wrote:
>When I use this syntax, I get the following error (a search on 800a0414
>produces no results on MSDN):
>
>Microsoft VBScript compilation error '800a0414'
>Cannot use parentheses when calling a Sub
>/admin/surveydump.asp, line 165
>.AttachFile(txtfile, "consumerdata")
>
>
> -----Original Message-----
>From: John Olival [mailto:john@r...]
>Sent: Thursday, April 19, 2001 12:45 AM
>To: ASP Web HowTo
>Subject: [asp_web_howto] RE: attachment on CDONTS email
>
>The right syntax for line 165 is
>
> .AttachFile(txtfile, "Caption for this attachment")
>hth
>John
Message #5 by "Daniel O'Dorisio" <dodorisio@h...> on Thu, 19 Apr 2001 14:52:18 -0400
|
|
i believe the correct syntax is:
.AttachFile txtfile,"caption"
Daniel
-----Original Message-----
From: Richard Graves [mailto:richgraves@m...]
Sent: Thursday, April 19, 2001 2:14 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
When I use this syntax, I get the following error (a search on 800a0414
produces no results on MSDN):
Microsoft VBScript compilation error '800a0414'
Cannot use parentheses when calling a Sub
/admin/surveydump.asp, line 165
.AttachFile(txtfile, "consumerdata")
-----Original Message-----
From: John Olival [mailto:john@r...]
Sent: Thursday, April 19, 2001 12:45 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
The right syntax for line 165 is
.AttachFile(txtfile, "Caption for this attachment")
hth
John
Message #6 by Rita Greenberg <rg1@h...> on Thu, 19 Apr 2001 12:09:45 -0700
|
|
Just take out the parentheses - .AttachFile txtfile, "consumerdata" - and it
should work.
-----Original Message-----
From: Richard Graves [mailto:richgraves@m...]
Sent: Thursday, April 19, 2001 11:14 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
When I use this syntax, I get the following error (a search on 800a0414
produces no results on MSDN):
Microsoft VBScript compilation error '800a0414'
Cannot use parentheses when calling a Sub
/admin/surveydump.asp, line 165
.AttachFile(txtfile, "consumerdata")
-----Original Message-----
From: John Olival [mailto:john@r...]
Sent: Thursday, April 19, 2001 12:45 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
The right syntax for line 165 is
.AttachFile(txtfile, "Caption for this attachment")
hth
John
Message #7 by "Richard Graves" <richgraves@m...> on Thu, 19 Apr 2001 18:46:07 -0700
|
|
Taking the parenthesis off produces this error. Sorry to be a helpless fool
about this, but I have tried every combination of () and "" you can think
of. I think this is the first time that I have looked something up in the
WROX Professional ASP3.0 and it has not worked perfectly for me the first
time. In there on page 857, they have the (). 800a000d produces some
results that I'm not sure apply here.
Microsoft VBScript runtime error '800a000d'
Type mismatch
/admin/surveydump.asp, line 165
-----Original Message-----
From: Daniel O'Dorisio [mailto:dodorisio@h...]
Sent: Thursday, April 19, 2001 11:52 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
i believe the correct syntax is:
.AttachFile txtfile,"caption"
Daniel
-----Original Message-----
From: Richard Graves [mailto:richgraves@m...]
Sent: Thursday, April 19, 2001 2:14 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
When I use this syntax, I get the following error (a search on 800a0414
produces no results on MSDN):
Microsoft VBScript compilation error '800a0414'
Cannot use parentheses when calling a Sub
/admin/surveydump.asp, line 165
.AttachFile(txtfile, "consumerdata")
-----Original Message-----
From: John Olival [mailto:john@r...]
Sent: Thursday, April 19, 2001 12:45 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
The right syntax for line 165 is
.AttachFile(txtfile, "Caption for this attachment")
hth
John
Message #8 by "TomMallard" <mallard@s...> on Thu, 19 Apr 2001 19:21:39 -0700
|
|
Try without the "with" syntax...just for fun.
objSendMail.From = "rgraves@k..."
objSendMail.To = aEmailaddress
objSendMail.Subject = "Data retrieval you requested"
objSendMail.Body = "Here is a text file of the data you requested. You may
import it into excel using a semi-colon (;) as a delimiter."
objSendMail.AttachFile = txtfile (this is line 165)
objSendMail.Send
tom
----- Original Message -----
From: "Richard Graves" <richgraves@m...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Thursday, April 19, 2001 6:46 PM
Subject: [asp_web_howto] RE: attachment on CDONTS email
> Taking the parenthesis off produces this error. Sorry to be a helpless
fool
> about this, but I have tried every combination of () and "" you can think
> of. I think this is the first time that I have looked something up in the
> WROX Professional ASP3.0 and it has not worked perfectly for me the first
> time. In there on page 857, they have the (). 800a000d produces some
> results that I'm not sure apply here.
>
>
> Microsoft VBScript runtime error '800a000d'
> Type mismatch
> /admin/surveydump.asp, line 165
>
>
> -----Original Message-----
> From: Daniel O'Dorisio [mailto:dodorisio@h...]
> Sent: Thursday, April 19, 2001 11:52 AM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: attachment on CDONTS email
>
> i believe the correct syntax is:
>
> .AttachFile txtfile,"caption"
>
> Daniel
>
> -----Original Message-----
> From: Richard Graves [mailto:richgraves@m...]
> Sent: Thursday, April 19, 2001 2:14 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: attachment on CDONTS email
>
>
> When I use this syntax, I get the following error (a search on 800a0414
> produces no results on MSDN):
>
> Microsoft VBScript compilation error '800a0414'
> Cannot use parentheses when calling a Sub
> /admin/surveydump.asp, line 165
> .AttachFile(txtfile, "consumerdata")
Message #9 by "John Olival" <john@r...> on Fri, 20 Apr 2001 08:37:40 +0100
|
|
Also make sure that you have commented out your comment saying '(this is
line 165)
-----Original Message-----
From: TomMallard [mailto:mallard@s...]
Sent: 20 April 2001 03:22
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
Try without the "with" syntax...just for fun.
objSendMail.From =3D "rgraves@k..."
objSendMail.To =3D aEmailaddress
objSendMail.Subject =3D "Data retrieval you requested"
objSendMail.Body =3D "Here is a text file of the data you requested.
You
may
import it into excel using a semi-colon (;) as a delimiter."
objSendMail.AttachFile =3D txtfile (this is line 165)
objSendMail.Send
tom
----- Original Message -----
From: "Richard Graves" <richgraves@m...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Thursday, April 19, 2001 6:46 PM
Subject: [asp_web_howto] RE: attachment on CDONTS email
> Taking the parenthesis off produces this error. Sorry to be a
helpless
fool
> about this, but I have tried every combination of () and "" you can
think
> of. I think this is the first time that I have looked something up in
the
> WROX Professional ASP3.0 and it has not worked perfectly for me the
first
> time. In there on page 857, they have the (). 800a000d produces some
> results that I'm not sure apply here.
>
>
> Microsoft VBScript runtime error '800a000d'
> Type mismatch
> /admin/surveydump.asp, line 165
>
>
> -----Original Message-----
> From: Daniel O'Dorisio [mailto:dodorisio@h...]
> Sent: Thursday, April 19, 2001 11:52 AM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: attachment on CDONTS email
>
> i believe the correct syntax is:
>
> .AttachFile txtfile,"caption"
>
> Daniel
>
> -----Original Message-----
> From: Richard Graves [mailto:richgraves@m...]
> Sent: Thursday, April 19, 2001 2:14 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: attachment on CDONTS email
>
>
> When I use this syntax, I get the following error (a search on
800a0414
> produces no results on MSDN):
>
> Microsoft VBScript compilation error '800a0414'
> Cannot use parentheses when calling a Sub
> /admin/surveydump.asp, line 165
> .AttachFile(txtfile, "consumerdata")
Message #10 by Rita Greenberg <rg1@h...> on Thu, 19 Apr 2001 12:09:45 -0700
|
|
Just take out the parentheses - .AttachFile txtfile, "consumerdata" - and it
should work.
-----Original Message-----
From: Richard Graves [mailto:richgraves@m...]
Sent: Thursday, April 19, 2001 11:14 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
When I use this syntax, I get the following error (a search on 800a0414
produces no results on MSDN):
Microsoft VBScript compilation error '800a0414'
Cannot use parentheses when calling a Sub
/admin/surveydump.asp, line 165
.AttachFile(txtfile, "consumerdata")
-----Original Message-----
From: John Olival [mailto:john@r...]
Sent: Thursday, April 19, 2001 12:45 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: attachment on CDONTS email
The right syntax for line 165 is
.AttachFile(txtfile, "Caption for this attachment")
hth
John
-----Original Message-----
From: Richard Graves [mailto:richgraves@m...]
Sent: 19 April 2001 01:13
To: ASP Web HowTo
Subject: [asp_web_howto] attachment on CDONTS email
I am trying to send an email with an attached txt file. The file is
created
fine, but then the code busts on the line where the file is attached to
the
email. Everywhere I look, it says to do it the same way, but it breaks
on
me.
This is the error.
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'AttachFile'
/admin/surveydump.asp, line 165
and this is the code that generates the error:
pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
Set txtfile
filesys.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH
_INF
O")),pathEnd)&"\" & textfilename)
Set objSendMail = CreateObject("CDONTS.NewMail")
With objSendMail
.From = "rgraves@k..."
.To = aEmailaddress
.Subject = "Data retrieval you requested"
.Body = "Here is a text file of the data you requested. You may
import it
into excel using a semi-colon (;) as a delimiter."
.AttachFile = txtfile (this is line 165)
.Send
End With
Does anyone know what the problem with this is?
|
|
 |