User home
Store
System help
Ask a question
Search help
Login
   Help system Content Search
Article content
Send an Email message using CDOSYS
CDOSYS is enabled by default. The SMTP server and Authentication information will be given when you create a mailbox

C# ASP.Net example:
   
 C# ASP.Net example: 
    
    using System.Web.Mail; 
    
    eMail = new MailMessage(); 
    eMail.BodyFormat = MailFormat.Text; 
    eMail.From = _SendFrom; 
    eMail.Fields["http://schemas.microsoft.com/cdo/configuration/smtsperver"] = "SMTPServerName"; 
    eMail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = 25; 
    eMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2; 
    if (SMTPUser != null && SMTPPassword != null) 
    { 
    eMail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1; 
    eMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = "SMTPAUTHUser"; 
    eMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "SMTPAUTHPassword"; 
    } 
    eMail.To = "recipients"; 
    SmtpMail.SmtpServer = SMTPServerName; 
    SmtpMail.Send(eMail); 
   
    
Classic ASP code example:
   
   Dim ObjSendMail
   Set ObjSendMail = CreateObject("CDO.Message")
   
   'This section provides the configuration information for the remote SMTP server.
   
   ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
   ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.yoursite.com"
   ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
   ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
   ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
   
   ' authentication
   ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
   ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourserver.com"
   ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword"
   
   ObjSendMail.Configuration.Fields.Update
   
   'End remote SMTP server configuration section==
   
   ObjSendMail.To = "someone@someone.net"
   ObjSendMail.Subject = "this is the subject"
   ObjSendMail.From = "someone@someone.net"
   
   ' we are sending a text email.. simply switch the comments around to send an html email instead
   'ObjSendMail.HTMLBody = "this is the body"
   ObjSendMail.TextBody = "this is the body"
   
   ObjSendMail.Send
   
   Set ObjSendMail = Nothing
© Copyright 2017 Doka management panel