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

推荐订阅源

云风的 BLOG
云风的 BLOG
Hacker News: Ask HN
Hacker News: Ask HN
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
The Exploit Database - CXSecurity.com
The Hacker News
The Hacker News
Security Latest
Security Latest
Attack and Defense Labs
Attack and Defense Labs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Scott Helme
Scott Helme
H
Heimdal Security Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
WordPress大学
WordPress大学
雷峰网
雷峰网
L
LangChain Blog
Y
Y Combinator Blog
I
Intezer
V
Vulnerabilities – Threatpost
Apple Machine Learning Research
Apple Machine Learning Research
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
W
WeLiveSecurity
P
Privacy International News Feed
V
Visual Studio Blog
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
AI
AI
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
Martin Fowler
Martin Fowler
K
Kaspersky official blog
U
Unit 42
S
Schneier on Security
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
T
Tor Project blog
aimingoo的专栏
aimingoo的专栏
Engineering at Meta
Engineering at Meta
G
GRAHAM CLULEY
美团技术团队
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Google DeepMind News
Google DeepMind News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
P
Proofpoint News Feed
爱范儿
爱范儿
F
Fortinet All Blogs
有赞技术团队
有赞技术团队

博客园 - 学剑学诗两不成

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