| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Classic ASP/VBScript - ASP Mail Component Test
I just created this a while ago to help a member here test if they had some mail components installed:
Code:
<%
Sub errorCheck(errObj)
if errObj <> 0 then
response.write "This component is not available on this server.<br>"
err.clear
else
response.write "This component is available on this server.<br>"
end if
response.write "</p>"
End Sub
Dim obTest
On Error Resume Next
Set obTest = Server.CreateObject("CDONTS.NEWMAIL")
Response.write "<P><strong>Testing CDONTS mail component...</strong><br>"
errorCheck(err)
Set obTest = Server.CreateObject("JMAIL.SMTPMAIL")
Response.write "<P><strong>Testing JMail component...</strong><br>"
errorCheck(err)
Set obTest = Server.CreateObject("Persits.MailSender")
Response.write "<P><strong>Testing ASPEmail component...</strong><br>"
errorCheck(err)
Set obTest = Server.CreateObject("CDO.MESSAGE")
Response.write "<P><strong>Testing CDO mail component...</strong><br>"
errorCheck(err)
Set obTest = Nothing
%>
Save this script in a new page and, of course, save it with .asp extension. Simply run it and it will tell which, if any, mail components are installed. If anyone knows of any other mail components to add to this, let me know and I will put it in the script. Mods, feel free to modify it yourself ![]()
__________________
jmurrayhead Did I help you out? Make me popular by clicking the icon!New Members:Proper way to post a question Powered by ASP.Net Last edited by jmurrayhead : July 19th, 2007 at 11:12 AM. |
|
#2
|
||||
|
||||
|
nice one JMH ... but unlike you, I was too lazy to write my own and had found these at Pensaworks. it allows you to not only test for email components but hundreds of other components as well.
__________________
Come JOIN the party!!! Quote of the Month: Retirement: Because you've given so much of yourself to the company that you don't have anything left we can use. Questions to Ponder: What do you do when you see an endangered animal eating an endangered plant? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright© 2008 sbenj69 |
|
#3
|
|||
|
|||
|
Quote:
Nice find...I shall have to take a deeper look at it some time and modify my script ![]() |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Classic ASP/VBScript - ASP Mail Component Test |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|