ASP Hosting Top Header
Easy ASP Hosting Logo ASP.NET Hosting
ASP Hosting Contact Information
Windows Hosting
         Home         Hosting         Domains         Support          Order Windows 2003 Hosting
Helm Hosting
 

DevMailerCOM Object Sample

DevMailer is a COM (Component Object Model) object designed to send Email via SMTP from any COM / OLE / ActiveX enabled application. More information can be found at http://www.geocel.com/devmailer

The following is a working sample of how this component works on Active Server hosting accounts. There are literally thousands of other combinations, colors, methods, etc that could be used to accomplish the same function. Please note that we do not provide support for this sample. It is only provided as a guide to help you get started.

All the ASP code is documented. What is not documented is the plain HTML tables which were added for aesthetic purposes.

Please note: When using any ASP Mail COM Objects, you must use the specific internal email IP address assigned to that server and "2525" as the port number. We configure SMTP on a non-routable, internal IP with an odd port number so that people can send email through ASP scripts, without having to deal with SMTP authentication issues. You can find out what IP address you should be using by clicking here.

This is what the ASP code looks like:


<%
' Check to see if the "EmailTo" field as filled out, if it was, assume
' all other fields were filled out and try to send email
If Len(Request("EmailTo")) > 0 Then

' Create DevMailer Object
Set Mailer = CreateObject("Geocel.Mailer")

' Add first SMTP server
Mailer.AddServer "192.168.1.35",2525 (this will change depending on which server your account resides on, click here to find out what IP address is assigned to your server.


' Set Sender Information
Mailer.FromAddress = Request("EmailFrom")
Mailer.FromName = Request("EmailFromName")

' Add a recipient to the message
Mailer.AddRecipient Request("EmailTo"),Request("EmailToName")

' Set the Subject and Body
Mailer.Subject = Request("Subject")

Mailer.Body = Request("Body")

' Send Email - Perform Error Checking
bSuccess = Mailer.Send()

If bSuccess = False Then
     If Mailer.Queued = False Then
          Response.Write "Could not send message..queueing failed!"
     Else
          Response.Write "Could not send message..queued instead!"
     End If
Else
     Response.Write "Message Sent Successfully!"
End If

Else%>

<form name="form1">

           <table>
                      <tr>
                                 <td colspan="2"><b>DevMailer Sample</b></td>
                      </tr>

                      <tr>
                                 <td valign="top">Email From:</td>
                                 <td><input type="text" name="EmailFrom"></td>
                      </tr>

                      <tr>
                                 <td valign="top">Email From Name:</td>
                                 <td><input type="text" name="EmailFromName"></td>
                      </tr>

                      <tr>
                                 <td valign="top">Email To:</td>
                                 <td><input type="text" name="EmailTo"></td>
                      </tr>

                      <tr>
                                 <td valign="top">Email To Name:</td>
                                 <td><input type="text" name="EmailToName"></td>
                      </tr>

                      <tr>
                                 <td valign="top">Subject:</td>
                                 <td><input type="text" name="Subject"></td>
                      </tr>

                      <tr>
                                 <td valign="top">Body:</td>
                                 <td><textarea cols="40" rows="10" name="Body"></textarea></td>
                      </tr>

                      <tr>
                                 <td></td>
                                 <td><input type="submit" value="Send Email"></td>
                      </tr>
           </table>
</form>

<%End If%>


And this is what it looks like in a web browser:

 

Home |  Hosting |  Resellers |  About Us |  Testimonials |  Site Map |  Contact Us |  Data Center |  Plesk |  Support |  Announcements |  Order