惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cybersecurity and Infrastructure Security Agency CISA
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Latest news
Latest news
L
LINUX DO - 热门话题
Cisco Talos Blog
Cisco Talos Blog
S
Securelist
T
Threatpost
AWS News Blog
AWS News Blog
P
Privacy & Cybersecurity Law Blog
C
CERT Recently Published Vulnerability Notes
B
Blog RSS Feed
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
T
Tor Project blog
P
Palo Alto Networks Blog
博客园 - 三生石上(FineUI控件)
人人都是产品经理
人人都是产品经理
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
H
Help Net Security
小众软件
小众软件
C
Cisco Blogs
有赞技术团队
有赞技术团队
Cyberwarzone
Cyberwarzone
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
S
Schneier on Security
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
The Register - Security
The Register - Security
Project Zero
Project Zero
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
V
Vulnerabilities – Threatpost
Security Latest
Security Latest
爱范儿
爱范儿
A
About on SuperTechFans
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
A
Arctic Wolf
大猫的无限游戏
大猫的无限游戏
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
K
Kaspersky official blog
Scott Helme
Scott Helme
Spread Privacy
Spread Privacy
The Hacker News
The Hacker News
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 学剑学诗两不成

VB:如何实现在代码中弹出toolbar的ButtonMenu VB:如何发送WM_KEYDOWN和WM_KEYUP消息 利用IDocHostUIHandler接口屏蔽WebBrowser的弹出菜单 VB:如何改变ComboBox自身的高度 VB:如何设置Richtextbox的行间距 VB:如何允许/禁止RICHTEXTBOX中的OLE对象拉伸 一个很有用的自定义函数 - 学剑学诗两不成 - 博客园 VB:如何隐藏/显示treeview的ToolTips - 学剑学诗两不成 - 博客园 VB:如何启用/禁用本地连接 VB:如何选定文件或文件夹 - 学剑学诗两不成 - 博客园 一个远程调用api函数的模块(转贴) VB:如何监听打开的窗口和程序 VB:如何隐藏ListView的某一列 vb:如何禁止鼠标指针进入某个区域 如何使frame控件的caption居中显示 - 学剑学诗两不成 - 博客园 怎样去掉窗体上的图标 - 学剑学诗两不成 - 博客园 VB中对string array快速插入、删除某个元素的办法 - 学剑学诗两不成 - 博客园 bug:在windows xp下用ImageList_GetImageCount返回值不正确(VB) - 学剑学诗两不成 - 博客园 VB中字符串数组快速复制的一种方法 - 学剑学诗两不成 - 博客园
VB:如何用需要身份验证的SMTP邮件服务器发信 - 学剑学诗两不成 - 博客园
学剑学诗两不成 · 2006-01-24 · via 博客园 - 学剑学诗两不成

Option Explicit
'需要引用  Microsoft CDO for Windows 2000 Library和 Microsoft ActiveX Data Objects 2.5 Library

Private Sub Command1_Click()
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

' Get a handle on the config object and it's fields
Set objConfig = New CDO.Configuration
Set Fields = objConfig.Fields

' Set config fields we care about
With Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "smtp邮件服务器"
    .Item(cdoSMTPServerPort) = 25 '端口,默认为25
    .Item(cdoSMTPConnectionTimeout) = 10
    .Item(cdoSMTPAuthenticate) = cdoBasic
    .Item(cdoSendUserName) = "用户名"
    .Item(cdoSendPassword) = "密码"

    .Update
End With

Set objMessage = New CDO.Message '

Set objMessage.Configuration = objConfig

With objMessage
    .To = "收件人地址"
    .From = "Display Name <email_address>"
    .Subject = "SMTP Relay Test"
    .TextBody = "SMTP Relay Test Sent @ " & Now()
    .Send
End With

Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing

End Sub