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", "you@company.com", _
                  "Schedule", "Here's the latest master schedule", 0
  Set objNewMail = Nothing


Logo

GitCode 天启AI是一款由 GitCode 团队打造的智能助手,基于先进的LLM(大语言模型)与多智能体 Agent 技术构建,致力于为用户提供高效、智能、多模态的创作与开发支持。它不仅支持自然语言对话,还具备处理文件、生成 PPT、撰写分析报告、开发 Web 应用等多项能力,真正做到“一句话,让 Al帮你完成复杂任务”。

更多推荐