CDO. Message sends the producer

Source: Internet
Author: User
<%
Const cdosendusingmethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdosendusingport = 2
Const cdosmtpserver = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdosmtpserverport = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdosmtpconnectiontimeout = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdosmtpauthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdobasic = 1
Const cdosendusername = "http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdosendpassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword"

Dim objconfig 'as CDO. Configuration
Dim objmessage 'as CdO. Message
Dim fields 'As ADODB. Fields

Set objconfig = server. Createobject ("CDO. Configuration ")
Set fields = objconfig. Fields

With fields
. Item (cdosendusingmethod) = cdosendusingport
. Item (cdosmtpserver) = "sony.com" 'is changed to an available external email server domain name.
. Item (cdosmtpserverport) = 25
. Item (cdosmtpconnectiontimeout) = 10
. Item (cdosmtpauthenticate) = cdobasic
. Item (cdosendusername) = "hoke" 'user name of the server above
. Item (cdosendpassword) = "mypassword" 'Password
. Update
End

Set objmessage = server. Createobject ("CDO. Message ")
Set objmessage. Configuration = objconfig

With objmessage
. To = "F4@meteorgardon.com" 'to the recipient's email address
. From = "hooke@sony.com" 'changed to the sender's email address
. Subject = "SMTP relay test" 'title
. Textbody = "SMTP relay test sent @" & now () 'body
. Send
End

Set fields = nothing
Set objmessage = nothing
Set objconfig = nothing
%>

Google search CDO. Message

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.