IIS服务器的SMTP发送邮件

IIS服务器中安装好SMTP送信服务后,在asp net中很简单的代码就实现发送邮件的功能。

属性 版本 类型 访问权限
Bcc 12 String 只读
Body 12 IStream オブジェクトまたは String 只读
BodyFormat 12 Long 只读
Cc 12 String 只读
ContentBase 12 String 只读
ContentLocation 12 String 只读
From 12 String 只读
Importance 12 Long 只读
MailFormat 12 Long 只读
Subject 12 String 書只读
To 12 String 只读
Value 12 String 只读
Version 12 String 只读


方法 版本 参数
AttachFile 12 Source as Object 或者 String,
(可省略) FileName as String,
(可省略) EncodingMethod as Long
AttachURL 12 Source as Object 或者 String,
ContentLocation as String,
(可省略) ContentBase as String,
(可省略) EncodingMethod as Long
Send 12 (可省略) From as String,
(可省略) To as String,
(可省略) Subject as String,
(可省略) Body as Object または String,
(可省略) Importance as Long
SetLocaleIDs 12 CodePageID as Long


送信示例代码:

  Set objNewMail = CreateObject("CDONTS.NewMail")
  objNewMail.AttachFile("\\server\schedule\sched.xls", "SCHED.XLS")
  objNewMail.Send "Automated Schedule Generator", "[email protected]", _
                  "Schedule", "Here's the latest master schedule", 0
  Set objNewMail = Nothing


你可能感兴趣的:(IIS服务器的SMTP发送邮件)