p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: "From" in CDONTS


Message #1 by edmundcs@m... on Thu, 23 Mar 2000 7:29:7
Oops, made a mistake in one of the lines b4.  Here is the correct way:

Sub SendMail ( strFromName, strFromAddress, strToName, strToPerson,
strSubject, strBody )
	' Uses CDO for NTS objects, with MS SMTP Service
	Set objMsg = Server.CreateObject("CDONTS.NewMail")
	objMsg.Value("Reply-To") = strFromAddress

	if Trim(strFromName) = "" then
		objMsg.From = strFromAddress
	else
		objMsg.From = strFromName & " <" & strFromAddress & ">"
	end if

	if Trim(strToName) = "" then
		objMsg.To = strToPerson
	else
		objMsg.To = strToName & " <" & strToPerson & ">"
	end if

	objMsg.Subject = strSubject
	objMsg.Importance = 1
	objMsg.BodyFormat = 1
	objMsg.MailFormat = 0
	objMsg.Body = strBody
	objMsg.Send
	Set objMsg = Nothing
End Sub

Mehul Harry
Software Developer
http://www.Evertek.com


-----Original Message-----
From: edmundcs@m... 
Sent: Thursday, March 23, 2000 12:00 AM
To: Code Clinic
Subject: [proasp_codeclinic] "From" in CDONTS


hi everyone,

i have a question regarding CDONTS. usually when
we open an email, the headers would be something
like this :

Date: Wed, 22 Mar 2000
From: <someone@s...>
To: <anotherone@a...>
Subject: the subject
...

is there a way i can insert a text string before the
"From" and "To" headers so it would look like this :

Date: Wed, 22 Mar 2000
From: "Someone" <someone@s...>
To: "AnotherOne" <anotherone@a...>
Subject: the subject
...

help appreciated. thanks.


  Return to Index