CDO in header?

Discussion in 'ASP General' started by Keith D, Jun 12, 2006.

  1. Keith D

    Keith D Guest

    I have multiple asp files which used CDONTS. As we are switching over to
    CDOSYS these files need to be updated. Is there a way that the cdo commands
    can be called from one general area, rather then have to modify each file?

    Thanks
     
    Keith D, Jun 12, 2006
    #1
    1. Advertising

  2. Sure! Have an #include file that handles the mail with a function.

    -- mail.asp

    <%
    Function SendMail(From, To, Subject, Body)
    Set cdo = CreateObject("CDO.Message")
    ...
    Set cdo = Nothing
    End Function
    %>

    -- any other page

    <!--#include file=mail.asp-->
    <%
    Call SendMail("", "", "This is a subject", "This is
    a body")
    %>




    "Keith D" <Keith > wrote in message
    news:D...
    >I have multiple asp files which used CDONTS. As we are switching over to
    > CDOSYS these files need to be updated. Is there a way that the cdo
    > commands
    > can be called from one general area, rather then have to modify each file?
    >
    > Thanks
     
    Aaron Bertrand [SQL Server MVP], Jun 12, 2006
    #2
    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. Guest
    Replies:
    2
    Views:
    898
    dave wanta
    Jul 11, 2003
  2. Newsgroup - Ann
    Replies:
    4
    Views:
    721
    lilburne
    Nov 2, 2003
  3. mlt
    Replies:
    2
    Views:
    864
    Jean-Marc Bourguet
    Jan 31, 2009
  4. majlandt
    Replies:
    3
    Views:
    279
    Anthony Jones
    Oct 17, 2006
  5. Replies:
    0
    Views:
    288
Loading...

Share This Page