Remind password    Register

Frequently Asked Questions -> Windows -> Scripting

How to send mail using ASP scripts?

Sample script:
(unnecessary lines are marked in square brackets [])


mailtext = "Text in message body"


Set iMsg = CreateObject("CDO.Message")

[iMsg.BodyPart.Charset = "windows-1251"]

[set iConf = CreateObject("CDO.configuration")]

[set flds = iConf.fields]

[flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2]

[flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "some SMTP server"]

[flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25]

[flds.update]

[Set iMsg.Configuration = iConf]

With iMsg

.From = """Bill Smith"" "

.To = "mail@domain.com"

.Subject = "Message subject"

.Htmlbody = mailtext

.Send

end with

[set flds = nothing]

[Set iconf = nothing]

Set iMsg = nothing
 
Home page | Services | Tech support | For users | About us


Copyright © Best-Hosting.net 2001-2017, All Rights Reserved.
"Company Best Hosting" LLC.
  Privacy Policy | Terms of Use

Phone/fax: +7 495 788-94-84
E-mail: support@best-hosting.ru