DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > Code Samples > Classic ASP

Discuss "ASP/VBScript Simple Mail Component Test" in the Classic ASP forum.

Classic ASP - Post your Classic ASP code samples here.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old March 20th, 2008, 09:47 AM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 537
Thanks: 14
Thanked 40 Times in 39 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default ASP/VBScript Simple Mail Component Test

This is a very simple mail component test that checks for a few common mail components on your server.
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.
It's simple to add new mail components to this, also.
__________________
jmurrayhead
Did I help you out? Make me popular by clicking the icon!

If you found a post helpful, please click the button in the lower right-hand corner of the post.

Powered by ASP.Net
Reply With Quote
Sponsored Links
Reply

  DeveloperBarn Forums > Programming & Scripting > Code Samples > Classic ASP

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 09:21 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46