Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: Use AttachFile & AttachURL in same message


Message #1 by rfinks@c... on Fri, 3 May 2002 15:11:45 -0500
I have a problem with an email message I've constructed that uses both
AttachFile to attach a file to the email message and AttachURL for graphics
within the message. The Problem is that when I use both types of
attachments, both the message body and the attached file show up as
attachments. When I remove the AttachURLs then the message body is where it
belongs. Is there some way I can make these attachments behave properly and
still exist together. Code follows:

Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "docmgmt@c..." 
objMail.Subject = varDescription
objMail.BodyFormat = CdoBodyFormatHTML 
objMail.MailFormat = CdoMailFormatMIME 
objMail.To = Request.Form("txtEmailAddr") 
objMail.Body = strHTML 
If Request.Form("txtDelPref") = "attach" Then 
	varAttached 
Server.MapPath("/JMSDocMgmt/Documents/EstimateHTML/Estimate43.htm") 
	objMail.AttachFile varAttached, "Estimate43.htm" 
End If 
objMail.AttachURL Server.MapPath("/JMSDocMgmt/Images/JMSBackground1.gif"),
"JMSBackground1.gif" 
objMail.AttachURL Server.MapPath("/JMSDocMgmt/Images/EstimateHeading1.gif"),
"EstimateHeading1.gif" 
objMail.Send Set objMail = nothing 


  Return to Index