Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: CDONTS parameter problem


Message #1 by andy@a... on Thu, 26 Oct 2000 13:14:43 +0100
Hi All



Here is my code



        dim mail

	set mail=Server.CreateObject("CDONTS.Newmail")

	mail.From="Query System"

	mail.To=rstEmail("email")

	mail.Subject="New Query"

	mail.Body="You have a new query. ID - " & LastQueryID

	mail.Send

	set mail=nothing



Here is my problem - If I use a string in the mail.To ie "me@m..."

then it works, As you can see I have a database field, and it won't work.

I guess its a double quote, single quote, ampersand thing but I can't

figure it.



Thanx



Andy Green

Message #2 by =?iso-8859-1?Q?Gonzalo_Ruiz_de_Villa_Su=E1rez?= <gonzalo.ruizdevilla@a...> on Thu, 26 Oct 2000 14:39:06 +0200
Have you tried a Response.Write rstEmail("email") to see if it returns a

valid email address?

If it does then try something like



Dim strEmail

strEmail = CStr(rstEmail("email"))

mail.To = strEmail





-----Mensaje original-----

De: andy@a... [mailto:andy@a...]

Enviado el: jueves, 26 de octubre de 2000 22:28

Para: ASP CDO

Asunto: [asp_cdo] CDONTS parameter problem





Hi All



Here is my code



        dim mail

	set mail=Server.CreateObject("CDONTS.Newmail")

	mail.From="Query System"

	mail.To=rstEmail("email")

	mail.Subject="New Query"

	mail.Body="You have a new query. ID - " & LastQueryID

	mail.Send

	set mail=nothing



Here is my problem - If I use a string in the mail.To ie "me@m..."

then it works, As you can see I have a database field, and it won't work.

I guess its a double quote, single quote, ampersand thing but I can't

figure it.



Thanx



Andy Green



Message #3 by dont worry <aspmailbox@y...> on Thu, 26 Oct 2000 09:16:17 -0700 (PDT)
Maybe

****

rstEmail = "myemai@...."



Mail.To rstEmail

or

Mail.To = rstEmail

or 

Mail.To = "&rstEmail&"



Hope This Helps



--- andy@a... wrote:

> Hi All

> 

> Here is my code

> 

>         dim mail

> 	set mail=Server.CreateObject("CDONTS.Newmail")

> 	mail.From="Query System"

> 	mail.To=rstEmail("email")

> 	mail.Subject="New Query"

> 	mail.Body="You have a new query. ID - " &

> LastQueryID

> 	mail.Send

> 	set mail=nothing

> 

> Here is my problem - If I use a string in the

> mail.To ie "me@m..."

> then it works, As you can see I have a database

> field, and it won't work.

> I guess its a double quote, single quote, ampersand

> thing but I can't

> figure it.

> 

> Thanx

> 

> Andy Green

> 


  Return to Index