Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: CDONTS Attach File


Message #1 by "Pat Waddington" <paw@s...> on Sun, 8 Jul 2001 06:46:47 +0100

Can anyone please tell me the correct syntax for attaching a file to an 

email created using CDONTS?



Thank you

Pat



Message #2 by "Siegfried Weber" <sweber@c...> on Mon, 9 Jul 2001 13:47:11 +0200
According to the documentation:



Set objNewMail =3D CreateObject("CDONTS.NewMail")

With objNewMail

  .From =3D "postmaster@d..."

  .To =3D "somebody@d..."

  .MailFormat =3D CdoMailFormatMime

  .BodyFormat =3D CdoBodyFormatText

  .AttachFile "C:\autoexec.bat"

  .Subject =3D "Test"

  .Body =3D "Attached is the file you requested"

  .Send

End With



<Siegfried />



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

> From: Pat Waddington [mailto:paw@s...]

> Sent: Sunday, July 08, 2001 12:13 PM

> To: ASP CDO

> Subject: [asp_cdo] CDONTS Attach File

>

>

> Can anyone please tell me the correct syntax for attaching a file to

an =3D

> email created using CDONTS?

>

> Thank you

> Pat

>



Message #3 by "Pat Waddington" <paw@s...> on Mon, 9 Jul 2001 21:18:48 +0100
Many thanks, my code now works perfectly. I'd failed to spot that

.AttachFile doesn't need '='.

----- Original Message -----

From: "Siegfried Weber" <sweber@c...>

To: "ASP CDO" <asp_cdo@p...>

Sent: Monday, July 09, 2001 12:47 PM

Subject: [asp_cdo] RE: CDONTS Attach File





According to the documentation:



Set objNewMail = CreateObject("CDONTS.NewMail")

With objNewMail

  .From = "postmaster@d..."

  .To = "somebody@d..."

  .MailFormat = CdoMailFormatMime

  .BodyFormat = CdoBodyFormatText

  .AttachFile "C:\autoexec.bat"

  .Subject = "Test"

  .Body = "Attached is the file you requested"

  .Send

End With



<Siegfried />



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

> From: Pat Waddington [mailto:paw@s...]

> Sent: Sunday, July 08, 2001 12:13 PM

> To: ASP CDO

> Subject: [asp_cdo] CDONTS Attach File

>

>

> Can anyone please tell me the correct syntax for attaching a file to

an 

> email created using CDONTS?

>

> Thank you

> Pat

>
Message #4 by Foster Nathaniel <nfoster@s...> on Tue, 10 Jul 2001 09:15:57 -0400
I did that and it works well

objmail.AttachFile Server.MapPath("../folder/filetoupload.exe")





-----Message d'origine-----

De : Pat Waddington [mailto:paw@s...]

Envoy=E9 : 8 juillet, 2001 01:47

Objet : CDONTS Attach File







Can anyone please tell me the correct syntax for attaching a file to an 

=3D

email created using CDONTS?



Thank you

Pat

Message #5 by "cducker" <cducker@e...> on Thu, 19 Jul 2001 03:40:16
hmmm. i am having a similar problem but when i code as below i am getting 

a http 500 error.



(by the way is there something i need to change in IIs to get more 

informative error messages)



here is my code



code works fine when i comment out the objSendMail.attach line....



dim objSendMail

Set objSendMail = createobject("CDONTS.NewMail")





With objSendMail

	.From = request("from")

	.To = request("to")

	.Cc = request("cc")

	.Bcc = request("bcc")

	.Subject = request("subject")

	.BodyFormat = 0

	.MailFormat = 0

	.Body = body

	.AttachFile "C:\Autoexec.bat"

	.send

end with



	IF err <> 0 THEN

  		Response.Write ("<BR><BR>Error encountered: " & 

Err.Description)

	END IF

	

	

Set objSendMail = nothing



thanks





chris



> Many thanks, my code now works perfectly. I'd failed to spot that

> .AttachFile doesn't need '='.

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

> From: "Siegfried Weber" <sweber@c...>

> To: "ASP CDO" <asp_cdo@p...>

> Sent: Monday, July 09, 2001 12:47 PM

> Subject: [asp_cdo] RE: CDONTS Attach File

> 

> 

> According to the documentation:

> 

> Set objNewMail = CreateObject("CDONTS.NewMail")

> With objNewMail

>   .From = "postmaster@d..."

>   .To = "somebody@d..."

>   .MailFormat = CdoMailFormatMime

>   .BodyFormat = CdoBodyFormatText

>   .AttachFile "C:\autoexec.bat"

>   .Subject = "Test"

>   .Body = "Attached is the file you requested"

>   .Send

> End With

> 

> <Siegfried />

> 

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

> > From: Pat Waddington [mailto:paw@s...]

> > Sent: Sunday, July 08, 2001 12:13 PM

> > To: ASP CDO

> > Subject: [asp_cdo] CDONTS Attach File

> >

> >

> > Can anyone please tell me the correct syntax for attaching a file to

> an 

> > email created using CDONTS?

> >

> > Thank you

> > Pat

Message #6 by "Siegfried Weber" <sweber@c...> on Thu, 19 Jul 2001 14:17:16 +0200
Does the file "C:\autoexec.bat" exist on the server and has the NT

account running this code permissions to open it?



<Siegfried />





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

> From: cducker [mailto:cducker@e...]

> Sent: Thursday, July 19, 2001 5:40 AM

> To: ASP CDO

> Subject: [asp_cdo] RE: CDONTS Attach File

>

> hmmm. i am having a similar problem but when i code as below i am

getting

> a http 500 error.

>

> (by the way is there something i need to change in IIs to get more

> informative error messages)

>

> here is my code

>

> code works fine when i comment out the objSendMail.attach line....

>

> dim objSendMail

> Set objSendMail =3D createobject("CDONTS.NewMail")

>

>

> With objSendMail

> 	.From =3D request("from")

> 	.To =3D request("to")

> 	.Cc =3D request("cc")

> 	.Bcc =3D request("bcc")

> 	.Subject =3D request("subject")

> 	.BodyFormat =3D 0

> 	.MailFormat =3D 0

> 	.Body =3D body

> 	.AttachFile "C:\Autoexec.bat"

> 	.send

> end with

>

> 	IF err <> 0 THEN

>   		Response.Write ("<BR><BR>Error encountered: " &

> Err.Description)

> 	END IF

>

>

> Set objSendMail =3D nothing

>

> thanks

>

>

> chris

>

> > Many thanks, my code now works perfectly. I'd failed to spot that

> > .AttachFile doesn't need '=3D'.

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

> > From: "Siegfried Weber" <sweber@c...>

> > To: "ASP CDO" <asp_cdo@p...>

> > Sent: Monday, July 09, 2001 12:47 PM

> > Subject: [asp_cdo] RE: CDONTS Attach File

> >

> >

> > According to the documentation:

> >

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

> > With objNewMail

> >   .From =3D "postmaster@d..."

> >   .To =3D "somebody@d..."

> >   .MailFormat =3D CdoMailFormatMime

> >   .BodyFormat =3D CdoBodyFormatText

> >   .AttachFile "C:\autoexec.bat"

> >   .Subject =3D "Test"

> >   .Body =3D "Attached is the file you requested"

> >   .Send

> > End With

> >

> > <Siegfried />

> >

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

> > > From: Pat Waddington [mailto:paw@s...]

> > > Sent: Sunday, July 08, 2001 12:13 PM

> > > To: ASP CDO

> > > Subject: [asp_cdo] CDONTS Attach File

> > >

> > >

> > > Can anyone please tell me the correct syntax for attaching a file

to

> > an =3D

> > > email created using CDONTS?

> > >

> > > Thank you

> > > Pat

>

Message #7 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Thu, 19 Jul 2001 13:42:11 +0100
yes, and you can assign whatever permissions you want to it



-----Original Message-----

From: Siegfried Weber [mailto:sweber@c...]

Sent: 19 July 2001 13:17

To: ASP CDO

Subject: [asp_cdo] RE: CDONTS Attach File





Does the file "C:\autoexec.bat" exist on the server and has the NT

account running this code permissions to open it?



<Siegfried />







Message #8 by "Siegfried Weber" <sweber@c...> on Thu, 19 Jul 2001 14:56:02 +0200
And does it content anything? IIRC, in NT4/Win2k the file has 0 byte.

Doubt that you can attach a 0 byte file with CDONTS.



<Siegfried />



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

> From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

> Sent: Thursday, July 19, 2001 2:42 PM

> To: ASP CDO

> Subject: [asp_cdo] RE: CDONTS Attach File

>

> yes, and you can assign whatever permissions you want to it

>

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

> From: Siegfried Weber [mailto:sweber@c...]

> Sent: 19 July 2001 13:17

> To: ASP CDO

> Subject: [asp_cdo] RE: CDONTS Attach File

>

>

> Does the file "C:\autoexec.bat" exist on the server and has the NT

> account running this code permissions to open it?

>

> <Siegfried />

Message #9 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Thu, 19 Jul 2001 14:04:29 +0100
you're right, it is empty - presumably only there for legacy reasons



-----Original Message-----

From: Siegfried Weber [mailto:sweber@c...]

Sent: 19 July 2001 13:56

To: ASP CDO

Subject: [asp_cdo] RE: CDONTS Attach File





And does it content anything? IIRC, in NT4/Win2k the file has 0 byte.

Doubt that you can attach a 0 byte file with CDONTS.



<Siegfried />



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

> From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

> Sent: Thursday, July 19, 2001 2:42 PM

> To: ASP CDO

> Subject: [asp_cdo] RE: CDONTS Attach File

>

> yes, and you can assign whatever permissions you want to it

>

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

> From: Siegfried Weber [mailto:sweber@c...]

> Sent: 19 July 2001 13:17

> To: ASP CDO

> Subject: [asp_cdo] RE: CDONTS Attach File

>

>

> Does the file "C:\autoexec.bat" exist on the server and has the NT

> account running this code permissions to open it?

>

> <Siegfried />

Message #10 by "Vincent Vandermeeren" <vincentvdm@p...> on Sun, 22 Jul 2001 12:55:13 +0200
hi guys,

I have the code for this ...

@ the page who I've made it works fine ...

if you want to test it, plz feel free ...

You will find it on http://www.c-mail.be => e-cards



I'll post the code monday ....

Greetings,

Vincent



----- Original Message -----

From: cducker <cducker@e...>

To: ASP CDO <asp_cdo@p...>

Sent: Thursday, July 19, 2001 3:40 AM

Subject: [asp_cdo] RE: CDONTS Attach File





> hmmm. i am having a similar problem but when i code as below i am getting

> a http 500 error.

>

> (by the way is there something i need to change in IIs to get more

> informative error messages)

>

> 


  Return to Index