CDO in header?

K

Keith 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
 
A

Aaron Bertrand [SQL Server MVP]

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("(e-mail address removed)", "(e-mail address removed)", "This is a subject", "This is
a body")
%>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top