Actions
Share

Sending Mail Using Classic ASP on MaxESP

Our MaxESP product provides you with an SMTP server to send mail from your Classic ASP and .NET applications, however, sending mail via CDONTS is not supported because the SMTP server is not local to the web servers, and CDONTS has no ability to send mail via remote servers (or to authenticate).  The solution (for Classic ASP applications) is to use CDOSYS. Here is some sample code to get you started:

<%
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
    

'Configuration for remote SMTP server

'Network Send    
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name of SMTP server
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.maxesp.net"

'SMTP port
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    
'MaxESP SMTP servers require authentication

'Basic Authentication
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

'SMTP username as configured in the control panel
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="accountid-siteid@maxesp.net"

'SMTP user password as configured in the control panel
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="**********"
    
ObjSendMail.Configuration.Fields.Update

    
'Configuration for email message
    
'Email To address
ObjSendMail.To = "user1@domain.com"

'Email Subject
ObjSendMail.Subject = "Sending Email Using CDOSYS"

'Email From address
ObjSendMail.From = "user2@domain.com"
    
'Email Body
ObjSendMail.TextBody = "I just sent an email from my MaxESP site using CDOSYS!"
    
ObjSendMail.Send
    
Set ObjSendMail = Nothing
%>

Article ID: 751, Created On: 2/14/2010, Modified: 6/4/2010

Feedback (0)