Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   CDOSYS with Variable for To: email address (http://www.velocityreviews.com/forums/t800331-cdosys-with-variable-for-to-email-address.html)

Jess 12-29-2005 07:48 PM

CDOSYS with Variable for To: email address
 
Has anyone been able to use a variable for the To: line with CDOSYS? When I
put in a specific address like: myMail.To = "webster@thisplace.org" it works
fine. When I put in a variable like: myMail.To = areaDirector it doesn't
work. I did a reponse.write on the areaDirector and it comes out like it's
supposed to: webster@thisplace.org

Any ideas? Does it have something to do with the quote marks?

Kyle Peterson 12-29-2005 10:49 PM

Re: CDOSYS with Variable for To: email address
 
I Use variables with CDOSYS all the time. Never had an issue ever.
It's essentially the same thing in the end. You got something else going on.


"Jess" <Jess@discussions.microsoft.com> wrote in message
news:2E4DF36B-0829-4B0D-BC97-C3333B3F397A@microsoft.com...
> Has anyone been able to use a variable for the To: line with CDOSYS? When
> I
> put in a specific address like: myMail.To = "webster@thisplace.org" it
> works
> fine. When I put in a variable like: myMail.To = areaDirector it doesn't
> work. I did a reponse.write on the areaDirector and it comes out like
> it's
> supposed to: webster@thisplace.org
>
> Any ideas? Does it have something to do with the quote marks?




Kyle Peterson 12-29-2005 10:52 PM

Re: CDOSYS with Variable for To: email address
 
If you want tomsehting to pay around with this code uses variables for
everything as well and it all works fine.
http://www.powerasp.com/content/new/...ing_cdosys.asp


"Kyle Peterson" <kyle342@hotmail.com> wrote in message
news:e2AMqoMDGHA.2356@tk2msftngp13.phx.gbl...
>I Use variables with CDOSYS all the time. Never had an issue ever.
> It's essentially the same thing in the end. You got something else going
> on.
>
>
> "Jess" <Jess@discussions.microsoft.com> wrote in message
> news:2E4DF36B-0829-4B0D-BC97-C3333B3F397A@microsoft.com...
>> Has anyone been able to use a variable for the To: line with CDOSYS?
>> When I
>> put in a specific address like: myMail.To = "webster@thisplace.org" it
>> works
>> fine. When I put in a variable like: myMail.To = areaDirector it doesn't
>> work. I did a reponse.write on the areaDirector and it comes out like
>> it's
>> supposed to: webster@thisplace.org
>>
>> Any ideas? Does it have something to do with the quote marks?

>
>




Kyle Peterson 12-29-2005 10:57 PM

Re: CDOSYS with Variable for To: email address
 
tomsehting lol


"Kyle Peterson" <kyle342@hotmail.com> wrote in message
news:en$1CqMDGHA.2320@TK2MSFTNGP11.phx.gbl...
> If you want tomsehting to pay around with this code uses variables for
> everything as well and it all works fine.
> http://www.powerasp.com/content/new/...ing_cdosys.asp
>
>
> "Kyle Peterson" <kyle342@hotmail.com> wrote in message
> news:e2AMqoMDGHA.2356@tk2msftngp13.phx.gbl...
>>I Use variables with CDOSYS all the time. Never had an issue ever.
>> It's essentially the same thing in the end. You got something else going
>> on.
>>
>>
>> "Jess" <Jess@discussions.microsoft.com> wrote in message
>> news:2E4DF36B-0829-4B0D-BC97-C3333B3F397A@microsoft.com...
>>> Has anyone been able to use a variable for the To: line with CDOSYS?
>>> When I
>>> put in a specific address like: myMail.To = "webster@thisplace.org" it
>>> works
>>> fine. When I put in a variable like: myMail.To = areaDirector it
>>> doesn't
>>> work. I did a reponse.write on the areaDirector and it comes out like
>>> it's
>>> supposed to: webster@thisplace.org
>>>
>>> Any ideas? Does it have something to do with the quote marks?

>>
>>

>
>




Dave Anderson 12-30-2005 04:17 PM

Re: CDOSYS with Variable for To: email address
 
Jess wrote:
> Has anyone been able to use a variable for the To: line with CDOSYS?
> When I put in a specific address like: myMail.To =
> "webster@thisplace.org" it works fine. When I put in a variable
> like: myMail.To = areaDirector it doesn't work. I did a
> reponse.write on the areaDirector and it comes out like it's supposed
> to: webster@thisplace.org
>
> Any ideas? Does it have something to do with the quote marks?


It has nothing to do with quote marks. I suspect you are assigning an object
reference to your variable rather than a string value. For example:

areaDirector = oRS("director")

In the above example, VBScript will assign the default property only as long
as the recordset object is open, while this variation persists beyond the
lifespan of the recordset:

areaDirector = oRS.Fields("director").Value




--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.




All times are GMT. The time now is 07:41 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.