Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: Re: I am having a problem sending attachments


Message #1 by "Angelia Jarrard" <adj2@c...> on Thu, 1 Mar 2001 19:19:41
Here's some code that has worked for me. 



 .AttachFile "e:\inetpub\apps\RTFs\" & userrtf, "Employee Benefits 

Statement.rtf"









> Hii

> 

> I am trying to send some attachment using

> CDONTS.newmail component but i am getting

> errors at the .AttacFile line

> if i comment the line the bellow source

> code works out well..

> 

> Can somebody help me out..

> 

> thanks

> Satish.

> 

> the source code goes here

> 

> <% 

> strbody=" My test message  My test message  My test message  My test 

message "

> Set objMsg = Server.CreateObject("CDONTS.NewMail")

> With objMsg

>    .To ="satishkumar12@r..."

>    .From ="abc@a..."

>    .Subject =" My test message "

>    .MailFormat = CdoMailFormatMime

>    .BodyFormat = CdoBodyFormatHTML

>    .AttachFile("D:/satish/test/test.txt","test.txt",0)

>    .Body = strBody

>    .Send

> End With

> Set objMsg = nothing

> %>

> 

> 

Message #2 by alex_williams@b... on Fri, 30 Mar 2001 13:54:34
Here is one that worked for me, u may have to modfify it of course

with this i am able to send multiple attachments



myattach = Request.Form("attach")

myattach2 = Request.Form("attach2")

SET objmail = createobject("CDONTS.NEWMAIL")



objmail.From = Request.Form("emailfrom")

objmail.To = Request.Form("emailto")

objmail.Subject = "! ! ! ! ! ! !"

objmail.BodyFormat = 0

objmail.MailFormat = 0

objmail.Body = strHTML

objmail.attachfile server.MapPath  (myattach)

objmail.attachfile server.MapPath  (myattach2)



objmail.Send



Good Luck

> Here's some code that has worked for me. 

> 

>  .AttachFile "e:\inetpub\apps\RTFs\" & userrtf, "Employee Benefits 

> Statement.rtf"

> 

> 

> 

> 

> > Hii

> > 

> > I am trying to send some attachment using

> > CDONTS.newmail component but i am getting

> > errors at the .AttacFile line

> > if i comment the line the bellow source

> > code works out well..

> > 

> > Can somebody help me out..

> > 

> > thanks

> > Satish.

> > 

> > the source code goes here

> > 

> > <% 

> > strbody=" My test message  My test message  My test message  My test 

> message "

> > Set objMsg = Server.CreateObject("CDONTS.NewMail")

> > With objMsg

> >    .To ="satishkumar12@r..."

> >    .From ="abc@a..."

> >    .Subject =" My test message "

> >    .MailFormat = CdoMailFormatMime

> >    .BodyFormat = CdoBodyFormatHTML

> >    .AttachFile("D:/satish/test/test.txt","test.txt",0)

> >    .Body = strBody

> >    .Send

> > End With

> > Set objMsg = nothing

> > %>

> > 

> > 


  Return to Index