p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_cdo thread: RE: CDONTS object question.


Message #1 by "anne blankert" <anneb@x...> on Mon, 3 Mar 2003 00:20:50
> I agree, but that isn't an option. Gary, looks like you are certified in
> Goldmine. Do you have any other helpful hints? Am I able to set the
> Content-Type using the CDONTS object?
> 
> Lauralyn
> 
The following work-around worked for me.
Somewhere I found that cdonts has a problem that more than one line can be 
added to a particular header field. I used this flaw to set the 
content-type using the "subject" field.

See the code below:

function sendMail2(strEmailAddress, strFrom, strSubject, strMsg)
dim objMsg
dim ContentType

	ContentType = "multipart/alternative;" & vbcrlf & 
	"boundary=""=====================_208297406==.ALT"""

	set objMsg = Server.CreateObject("CDONTS.NewMail")

	objMsg.From = strFrom
	objMsg.To = strEmailAddress
	objMsg.Subject = strSubject & vbcrlf & "Content-Type: " & 
ContentType
	objMsg.BodyFormat = 0 '0 = html format, 1 = text format
	objMsg.MailFormat = 1 '0 = mime format, 1 = plain text format
	objMsg.Body = strMsg
	objMsg.Send
	sendmail2 = TRUE
end function

  Return to Index