CDOSYS with Variable for To: email address

Discussion in 'ASP General' started by Jess, Dec 29, 2005.

  1. Jess

    Jess Guest

    Has anyone been able to use a variable for the To: line with CDOSYS? When I
    put in a specific address like: myMail.To = "" 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:

    Any ideas? Does it have something to do with the quote marks?
    Jess, Dec 29, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > Has anyone been able to use a variable for the To: line with CDOSYS? When
    > I
    > put in a specific address like: myMail.To = "" 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:
    >
    > Any ideas? Does it have something to do with the quote marks?
    Kyle Peterson, Dec 29, 2005
    #2
    1. Advertising

  3. 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/self_submitting_contact_form_using_cdosys.asp


    "Kyle Peterson" <> wrote in message
    news:...
    >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" <> wrote in message
    > news:...
    >> Has anyone been able to use a variable for the To: line with CDOSYS?
    >> When I
    >> put in a specific address like: myMail.To = "" 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:
    >>
    >> Any ideas? Does it have something to do with the quote marks?

    >
    >
    Kyle Peterson, Dec 29, 2005
    #3
  4. tomsehting lol


    "Kyle Peterson" <> wrote in message
    news:en$...
    > 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/self_submitting_contact_form_using_cdosys.asp
    >
    >
    > "Kyle Peterson" <> wrote in message
    > news:...
    >>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" <> wrote in message
    >> news:...
    >>> Has anyone been able to use a variable for the To: line with CDOSYS?
    >>> When I
    >>> put in a specific address like: myMail.To = "" 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:
    >>>
    >>> Any ideas? Does it have something to do with the quote marks?

    >>
    >>

    >
    >
    Kyle Peterson, Dec 29, 2005
    #4
  5. 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 =
    > "" 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:
    >
    > 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.
    Dave Anderson, Dec 30, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GJH
    Replies:
    3
    Views:
    514
    no22nd
    Feb 1, 2006
  2. Akbur
    Replies:
    8
    Views:
    926
    Akbur
    Apr 13, 2007
  3. rschaeferhig
    Replies:
    4
    Views:
    239
  4. Beefminator

    CDOSYS email - create hyperlink in body?

    Beefminator, Aug 31, 2006, in forum: ASP General
    Replies:
    6
    Views:
    184
    Beefminator
    Sep 2, 2006
  5. RedMoosh

    creating bulk email through cdosys.dll

    RedMoosh, Oct 17, 2006, in forum: ASP General
    Replies:
    9
    Views:
    169
    RedMoosh
    Oct 24, 2006
Loading...

Share This Page