VBS通过SMTP发送邮件
来源:互联网 发布:三国志9y优化伴侣 编辑:程序博客网 时间:2024/05/16 01:46
mfrom="abcd@abcd.com"rcpt="abcd@abcd.com, abcd@abcd.com"attachfile=nullserverip="smtp.abcd.com"sbj="Subject"tbody="Hello World"Call SendMail(mfrom,rcpt,sbj,tbody,attachfile,serverIP)
Sub SendMail (mfrom,rcpt,sbj,tbody,attachfile,serverIP)'######### call SendMail (mfrom,rcpt,cc,sbj,tbody,serverIP) ##################'Use external smtp server to send mailif trim(rcpt) = "" or trim(mfrom) = "" then exit subend ifOn Error Resume Next Set objEmail = CreateObject("CDO.Message") objEmail.From = mfrom objEmail.To = rcpt' objEmail.Cc = cc' objEmail.Bcc = bcc objEmail.Subject = sbj objEmail.Textbody = tbody'Sending an HTML e-mail:' objEmail.HTMLBody = "This is a message."'Sending an HTML e-mail that sends a webpage from a website:' objEmail.CreateMHTMLBody "file://c:/mydocuments/test.htm" If Trim(attachfile) <> "" Then objEmail.AddAttachment attachfile objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = serverIP objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25'-------Type of authentication, NONE, Basic (Base64 encoded), NTLM--------'objEmail.Configuration.Fields.Item _'("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic'-------Your UserID/Passwd on the SMTP server for SMTP auth for mail sent-----'objEmail.Configuration.Fields.Item _'("http://schemas.microsoft.com/cdo/configuration/sendusername") = "USER_NAME"'objEmail.Configuration.Fields.Item _'("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSWORD"'-------Use SSL for the connection (False or True)---------'objEmail.Configuration.Fields.Item _'("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False'Connection Timeout in seconds (the maximum time CDO will try to establish a'--------connection to the SMTP server)---------'objEmail.Configuration.Fields.Item _'("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 objEmail.Configuration.Fields.Update objEmail.Send set objEmail=nothingEnd Sub
- VBS通过SMTP发送邮件
- 通过SMTP发送邮件
- 通过smtp发送邮件
- VBS使用SMTP协议发送邮件
- php通过smtp发送邮件
- SMTP 通过程序发送邮件
- powershell 通过SMTP发送邮件
- C#通过SMTP发送邮件
- telnet通过smtp发送邮件
- 用PHP通过SMTP发送邮件
- C#中通过SMTP发送邮件
- 使用PowerShell通过Smtp发送邮件
- 自定义脚本通过SMTP邮箱发送邮件
- 通过SMTP SERVER 无需身份验证发送邮件
- PHP如何通过SMTP验证发送邮件
- Linux通过SMTP Server发送邮件
- C#中通过smtp发送邮件
- c++通过smtp发送邮件总结
- 注册或取消注册.dll或.ocx组件
- TCP-IP详解卷1-10:动态路由协议
- poj 2823 Sliding Window (单调队列)
- TCP-IP详解卷1-11:UDP(User Datagram Protocol):用户数据报协议
- TCP-IP详解卷1-12:广播(Broadcast)和多播(Multicast)
- VBS通过SMTP发送邮件
- TCP-IP详解卷1-13:IGMP(Internet Group Management Protocol):Internet组管理协议
- Android-SQLite3 超基础入门
- 无聊,随便写写
- TCP-IP详解卷1-14:DNS(Domain Name System):域名系统
- TCP-IP详解卷1-15:TFTP(Trivial File Transfer Protocol):简单文件传送协议
- Agile PLM Web Service -1
- TCP-IP详解卷1-16:BOOTP(Bootstrap Protocol):引导程序协议
- TCP-IP详解卷1-17:TCP(Transmission Control Protocol):传输控制协议(服务和首部)