advice on ActiveX and HTML possibilities please

  • Goodday people,

    I have a question about DTS and its ActiveX Scripting possibilities.

    I am not a developer, just a very quick learner

    And i want to learn more about the possibilities to 'build'/'generate' HTML emails. And send them out to multiple recievers.  (this already works for plain text :satisfied

    What can be done from within a DTS package to build an HTML email with a given text from a database table?

    With this ActiveX script should i build up the html email from scratch, or can i maybe use some short of predefined template (stored in a db-table)? 

    Is it possible to use a sort of dynamic HTML? meaning, with the given text of the user, can this be changed to make it more personalized?  Dear Mister <...blabla...>

    Is any of this possible within ActiveX ? Or should i maybe use some other program or language to generate the HTML email and then call this program from the DTS ActiveX script?

    Got the idea of what i want?

    Any info or advice much appreciated.

     

    Cheers,

    Sander Schat

    The Netherlands

     

     

  • Assuming you are using CDOSYS to send your mail in your ActiveX script you can create HTML emails by using HTMLBody={text string with HTML markup} rather than TextBody. You can build the text line by line, read data from a database to substitute into the text, etc. You would need to create and open an ADODB.Recordset to get to your database data and simply loop through the recordset building a new HTMLBody string for each message:

    While not rs.eof
       msg="<HTML><BODY>"
       msg = msg & "<P>Dear " & rs.fields("First_Name").value&",</P>"
       msg=msg & "more text with HTML formatting and data substitutions"
       cdomsg.HTMLbody=msg
       cdomsg.send
       rs.movenext
    wend

    You can build an external HTML template file, read that and substitute rs.field values for tokens ("i.e. [FirstName]") in the records, but the process is essentially the same except now you've added in the complication of creating an FSO connection to read the HTML file.

     

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply