首页 资讯 正文
  • 本文约1181字,阅读需6分钟
  • 3323
  • 0
举报该广告
利用VBS 发送邮件(1

利用VBS 发送邮件(1

摘要
 
'SendMail.vbs  By You are my only https://www.14551.cn
qq = "370569533"  '这儿填写 发件 QQ号码
dd = "*********"  '这儿填写 发件 QQ密码
' 写这 东西主要是方 BAT 的调' 
运行方法 SendMail.vbs "370569533@QQ.com" "这是一封测试邮" "C:\test.txt"
'以上方法 会发送一份主题《这是一封测试邮件》内容为 C:\test.txt 
内容的邮 到作 邮箱'  
如果 C:\test.txt 文件不存   
将以 "C:\test.txt"
作为内容发送Set argv = WScript.Arguments
If argv.Count = 0 Then MsgBox 
"运行参数: 收件 主题 内容"+chr(13)+"
例如: 370569533@QQ.com 这是一封测试邮
这是测试邮件内容"+chr(13)+"内容可以是文
也可以是文本文件路径(此处是绝对路)"+chr(13)+"本代码为
QQ邮箱发送发送失败不会提"+chr(13)+""+chr(13)+"You are my only", 64+4096, "You are my only"
WScript.Quit End If on error resume next
Set Fso = CreateObject("Scripting.FileSystemObject")
File = argv(2)
If Fso.FileExists(File) Then
  Set frn = Fso.opentextfile(File,1)
  nei = frn.readall
Else
  nei = File
End If
Set Email = CreateObject("CDO.Message")
strName = "http://schemas.microsoft.com/cdo/configuration/"
Email.From = qq&"@qq.com"
Email.To = argv(0)
Email.Subject = argv(1)
Email.Textbody = nei&vbCrLf&vbCrLf&"You are my only https://www.14551.cn"
with Email.Configuration.Fields
 .Item(strName & "sendusing") = 2 
 .Item(strName & "smtpserver") = "smtp.qq.com"
 .Item(strName & "smtpserverport") = 25
 .Item(strName & "smtpauthenticate") = 1 
 .Item(strName & "sendusername") = qq
 .Item(strName & "sendpassword") = dd
 .Update
End With
Email.send利用VBS发 邮件

📱 扫码关注公众号

公众号二维码

扫描二维码关注我们,获取更多精彩内容
实时更新 · 干货满满

收藏

扫描二维码,在手机上阅读
评论
更换验证码
友情链接