CDO message help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jishnu

    CDO message help

    Hi All,
    Need CDO help
    <%@ Language=VBScri pt %>
    <%
    Dim iMsg
    Dim iConf
    Dim Flds
    Set iMsg = CreateObject("C DO.Message")
    Set iConf = CreateObject("C DO.Configuratio n")
    Set Flds = iConf.Fields
    Flds("http://xyz.com") = True
    Flds.Update

    With iMsg
    Set .Configuration = iConf
    .CreateMHTMLBod y "http://xyz.com"
    .HTMLBody="<h1> Jishnu</h1>
    .To = "jishnu.guhatha kurta@clout.com "
    .From = "CLOUT Reporting Unit <Reporting@clou t.com>"
    .Subject = "Daily Snapshot Report"
    .Send
    End With
    %>

    The problem with this it does not CreateMHTMLBODY but if I take the
    ..HTMLBODY off then .CReateMHTMLBOD Y works.
    I need to add some HTML body along with the url.
    Does anyone know how to correct the code.
    Thanks
  • Ray Costanzo [MVP]

    #2
    Re: CDO message help

    You're overwriting the body with the code you have. The .CreateHTMLBody
    method grabs the HTML string and gives that value to the .HTMLBody property.
    It'd be as though you're doing this:

    ..HTMLBody = "hi"
    ..HTMLBody = "bye"

    Would you expect "hibye" to be the .HTMLBody then? No, it'd just be "bye."


    If you want to concatenate more html to the body, do:

    ..CreateHTMLBod y "http..."
    ..HTMLBody = .HTMLBody & "<h1>.." '<--don't forget closing " as you did
    below

    Ray at work



    "Jishnu" <jishguha@yahoo .com> wrote in message
    news:80d9e10e.0 409071058.6694b dc@posting.goog le.com...[color=blue]
    > Hi All,
    > Need CDO help
    > <%@ Language=VBScri pt %>
    > <%
    > Dim iMsg
    > Dim iConf
    > Dim Flds
    > Set iMsg = CreateObject("C DO.Message")
    > Set iConf = CreateObject("C DO.Configuratio n")
    > Set Flds = iConf.Fields
    > Flds("http://xyz.com") = True
    > Flds.Update
    >
    > With iMsg
    > Set .Configuration = iConf
    > .CreateMHTMLBod y "http://xyz.com"
    > .HTMLBody="<h1> Jishnu</h1>
    > .To = "jishnu.guhatha kurta@clout.com "
    > .From = "CLOUT Reporting Unit <Reporting@clou t.com>"
    > .Subject = "Daily Snapshot Report"
    > .Send
    > End With
    > %>
    >
    > The problem with this it does not CreateMHTMLBODY but if I take the
    > .HTMLBODY off then .CReateMHTMLBOD Y works.
    > I need to add some HTML body along with the url.
    > Does anyone know how to correct the code.
    > Thanks[/color]


    Comment

    Working...