VBScript uses Cdo.message to send mail

Source: Internet
Author: User

1 ConstEmail_from ="[email protected]"2 ConstPassword ="Password"3 ConstEmail_to ="[email protected]"4 SetCDO =CreateObject("CDO. Message")5Cdos. Subject ="Test"6Cdos. from =Email_from7Cdos. to =email_to8Cdos. TextBody ="Hello world!"9 Constschema ="http://schemas.microsoft.com/cdo/configuration/"Ten  withCDO. Configuration.fields One. Item (Schema &"sendusing") =2 A. Item (Schema &"SmtpServer") ="smtp.163.com" -. Item (Schema &"smtpauthenticate") =1 -. Item (Schema &"Sendusername") =Email_from the. Item (Schema &"Sendpassword") =Password -. Item (Schema &"Smtpserverport") = - -. Item (Schema &"Smtpusessl") =True -. Item (Schema &"Smtpconnectiontimeout") = - + . Update - End  with +Cdos. Send

Save the above code to Sendemail.vbs, enter the directory by command, and input sendemail.vbs execute.

VBScript debugs in the Windows environment, input cscript sendemail.vbs//x in the command, and can enter VS environment debugging.

VBScript uses Cdo.message to send mail

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.