HTMLBody and variable

Discussion in 'ASP General' started by Serge Myrand, Aug 9, 2004.

  1. Serge Myrand

    Serge Myrand Guest

    Hi everybody,

    It seems that a variable cannot be assign to HTMLBody field. Am'I doing
    something wrong?

    - this line write a bold html phrase in the email body
    ..HTMLBody = "<HTML><HEAD><BODY><B>Here is the text body</BODY></HTML>"

    - this line produce an empty body. The variable TableData contains all
    the required HTML to construct the table. I Use Response.Write and see
    all the code in it..
    ..HTMLBody = "<HTML><HEAD><BODY>" & TableData & "</BODY></HTML>"

    thanks in advance
     
    Serge Myrand, Aug 9, 2004
    #1
    1. Advertising

  2. HTMLBody field of what???

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Serge Myrand" <> wrote in message
    news:...
    > Hi everybody,
    >
    > It seems that a variable cannot be assign to HTMLBody field. Am'I doing
    > something wrong?
    >
    > - this line write a bold html phrase in the email body
    > .HTMLBody = "<HTML><HEAD><BODY><B>Here is the text body</BODY></HTML>"
    >
    > - this line produce an empty body. The variable TableData contains all
    > the required HTML to construct the table. I Use Response.Write and see
    > all the code in it..
    > .HTMLBody = "<HTML><HEAD><BODY>" & TableData & "</BODY></HTML>"
    >
    > thanks in advance
    >
    >
     
    Aaron [SQL Server MVP], Aug 9, 2004
    #2
    1. Advertising

  3. Serge Myrand

    Serge Myrand Guest

    Hi,

    The HTMLBody field of CDO.Message

    ie:
    with iMsg
    .To =
    .From =
    .Subject =
    .HTMLBody =
    end With

    thank's
    serge

    "Aaron [SQL Server MVP]" wrote:

    > HTMLBody field of what???
    >
    > --
    > http://www.aspfaq.com/
    > (Reverse address to reply.)
    >
    > "Serge Myrand" <> wrote in message
    > news:...
    > > Hi everybody,
    > >
    > > It seems that a variable cannot be assign to HTMLBody field. Am'I doing
    > > something wrong?
    > >
    > > - this line write a bold html phrase in the email body
    > > .HTMLBody = "<HTML><HEAD><BODY><B>Here is the text body</BODY></HTML>"
    > >
    > > - this line produce an empty body. The variable TableData contains all
    > > the required HTML to construct the table. I Use Response.Write and see
    > > all the code in it..
    > > .HTMLBody = "<HTML><HEAD><BODY>" & TableData & "</BODY></HTML>"
    > >
    > > thanks in advance
    > >
    > >
     
    Serge Myrand, Aug 9, 2004
    #3
  4. Okay, so now that we know what you're talking about, can you give us more
    details?

    "It seems that a variable cannot be assign to HTMLBody field. Am'I doing
    something wrong?"

    What does "it seems" and "cannot be assign" mean? Do you get an error
    message? If so, what is it? Or does something else happen? Could you do
    us a favor and describe the actual symptom, instead of vague stories of
    failure?

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)
     
    Aaron [SQL Server MVP], Aug 9, 2004
    #4
  5. Serge Myrand

    Serge Myrand Guest

    Hi Aaron,

    The thing is that when I send and email and I construct the HTML code like
    shown in the example n°1
    the result is an HTML email showing the phrase (bold text): 'Here is the text
    body'
    In the example n° 2 the body of the email is empty, no text, nothing at all,
    even if the variable TableData contains valid HTML code that construct a table
    of several row with 5 columns of data. To make shure that TableData contains
    all the required HTML code I dumped it on the screen using Response.Write. If
    you prefer let say that TableData contains the phrase 'Here is the text body'

    It seems mean 'on dirai que' or 'it looks like'. Cannot be assign mean 'If I
    refer to a variable rather than a string'.
    No I do not get any error message I get an empty body (just the sender and
    receipient adresses nothing else).

    My question is. Why the body of the email is empty when I assing a variable to
    HTMLBody and it is not empty when I assing the HTML string (code) directly?
    What I am doing wrong?

    Example N°1: this line write a bold html text in the email body
    ..HTMLBody = "<HTML><HEAD><BODY><B>Here is the text body</BODY></HTML>"

    Example N°2: this line produce an empty body even if the variable 'TableData'
    contains all
    the required HTML to construct the table.
    ..HTMLBody = "<HTML><HEAD><BODY><B>" & TableData & "</BODY></HTML>"

    Thank you for your time
    serge

    "Aaron [SQL Server MVP]" wrote:

    > Okay, so now that we know what you're talking about, can you give us more
    > details?
    >
    > "It seems that a variable cannot be assign to HTMLBody field. Am'I doing
    > something wrong?"
    >
    > What does "it seems" and "cannot be assign" mean? Do you get an error
    > message? If so, what is it? Or does something else happen? Could you do
    > us a favor and describe the actual symptom, instead of vague stories of
    > failure?
    >
    > --
    > http://www.aspfaq.com/
    > (Reverse address to reply.)
     
    Serge Myrand, Aug 9, 2004
    #5
  6. Serge Myrand

    Serge Myrand Guest

    Hi,

    Forget about that it's my mistake. </TABLE> was missing in the variable
    (TableData) containing the HTML code, resulting in an empty body email. But it
    does not affect the result when using Response.Write TableData, the table
    draws on the screen..!

    thank you for your time
    serge



    "Aaron [SQL Server MVP]" wrote:

    > Okay, so now that we know what you're talking about, can you give us more
    > details?
    >
    > "It seems that a variable cannot be assign to HTMLBody field. Am'I doing
    > something wrong?"
    >
    > What does "it seems" and "cannot be assign" mean? Do you get an error
    > message? If so, what is it? Or does something else happen? Could you do
    > us a favor and describe the actual symptom, instead of vague stories of
    > failure?
    >
    > --
    > http://www.aspfaq.com/
    > (Reverse address to reply.)
     
    Serge Myrand, Aug 10, 2004
    #6
  7. Serge Myrand

    Patrice Guest

    What if you add the missing closing head tag ?

    Patrice
    --

    "Serge Myrand" <> a écrit dans le message de
    news:...
    > Hi Aaron,
    >
    > The thing is that when I send and email and I construct the HTML code like
    > shown in the example n°1
    > the result is an HTML email showing the phrase (bold text): 'Here is the

    text
    > body'
    > In the example n° 2 the body of the email is empty, no text, nothing at

    all,
    > even if the variable TableData contains valid HTML code that construct a

    table
    > of several row with 5 columns of data. To make shure that TableData

    contains
    > all the required HTML code I dumped it on the screen using Response.Write.

    If
    > you prefer let say that TableData contains the phrase 'Here is the text

    body'
    >
    > It seems mean 'on dirai que' or 'it looks like'. Cannot be assign mean 'If

    I
    > refer to a variable rather than a string'.
    > No I do not get any error message I get an empty body (just the sender and
    > receipient adresses nothing else).
    >
    > My question is. Why the body of the email is empty when I assing a

    variable to
    > HTMLBody and it is not empty when I assing the HTML string (code)

    directly?
    > What I am doing wrong?
    >
    > Example N°1: this line write a bold html text in the email body
    > .HTMLBody = "<HTML><HEAD><BODY><B>Here is the text body</BODY></HTML>"
    >
    > Example N°2: this line produce an empty body even if the variable

    'TableData'
    > contains all
    > the required HTML to construct the table.
    > .HTMLBody = "<HTML><HEAD><BODY><B>" & TableData & "</BODY></HTML>"
    >
    > Thank you for your time
    > serge
    >
    > "Aaron [SQL Server MVP]" wrote:
    >
    > > Okay, so now that we know what you're talking about, can you give us

    more
    > > details?
    > >
    > > "It seems that a variable cannot be assign to HTMLBody field. Am'I doing
    > > something wrong?"
    > >
    > > What does "it seems" and "cannot be assign" mean? Do you get an error
    > > message? If so, what is it? Or does something else happen? Could you

    do
    > > us a favor and describe the actual symptom, instead of vague stories of
    > > failure?
    > >
    > > --
    > > http://www.aspfaq.com/
    > > (Reverse address to reply.)

    >
     
    Patrice, Aug 10, 2004
    #7
    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. Kench
    Replies:
    2
    Views:
    5,428
    Victor Bazarov
    Jun 28, 2004
  2. dost
    Replies:
    2
    Views:
    360
    Mark P
    Apr 25, 2006
  3. mfglinux
    Replies:
    11
    Views:
    735
    Roberto Bonvallet
    Sep 12, 2007
  4. Tom Petersen
    Replies:
    5
    Views:
    147
    Tom Petersen
    Oct 13, 2005
  5. David Filmer
    Replies:
    19
    Views:
    265
    Kevin Collins
    May 21, 2004
Loading...

Share This Page