如何使用VBS垃圾邮件

时间:2015-08-08 12:28:29

标签: email vbscript

所以我想垃圾邮件来查看垃圾邮件过滤器。但是,它一直给我错误消息。如

  

无法连接到STMP服务器

请帮我改进一下。

Dim User
Dim Pass
Dim Name
Dim Input
Dim Input2
Dim Input3
X=MsgBox("Welcome. To log in Please Click OK and enter your G-mail & pass.",0,"EmailSpamBot V1.0")
User = InputBox("Enter your G-mail:")
Pass = InputBox("Enter Password:"& vbCrLf & ""& vbCrLf & "Please note passwords are NOT stored in this script and are case sensitive.")
Name = InputBox("Enter Name:")
Input = InputBox("Enter e-mail of victim:")
Input2 = InputBox("Enter title:")
Input3 = InputBox("Enter message:")
EmailSubject = (""& Input2)
EmailBody = (""& Input3)

'Const EmailFrom = ""
'Const EmailFromName = ""

Const SMTPServer = "smtp.gmail.com"
'Const SMTPLogon = ""
'Const SMTPPassword = ""
Const SMTPSSL = True
Const SMTPPort = 465

Const cdoSendUsingPickup = 1  'Send message using local SMTP service pickup directory.
Const cdoSendUsingPort = 2  'Send the message using SMTP over TCP/IP networking.

Const cdoAnonymous = 0  ' No authentication
Const cdoBasic = 1  ' BASIC clear text authentication
Const cdoNTLM = 2  ' NTLM, Microsoft proprietary authentication

' First, create the message

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = EmailSubject
objMessage.From = "<" & User & Name & ">"
objMessage.To = "<" & Input & ">"
objMessage.TextBody = EmailBody

' Second, configure the server

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = User

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = Pass

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPPort

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = SMTPSSL

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

objMessage.Configuration.Fields.Update

do
ObjMessage.Send 
loop

任何帮助都会非常值得赞赏

2 个答案:

答案 0 :(得分:0)

错误消息“无法连接到SMTP服务器”表示您的脚本无法与远程主机上的给定端口建立连接。这通常发生在防火墙阻止访问时。您可以使用telnet命令验证:

telnet smtp.gmail.com 465

如果访问被阻止,您应该在超时后获得这样的输出:

  

连接到smtp.gmail.com ...无法打开与主机的连接,在端口465上:连接失败

tracetcp这样的工具可以进一步了解数据包被阻止的位置。

但是,发送经过身份验证的邮件通常用于提交出站邮件。如果您想测试自己的垃圾邮件过滤器,则应该发送入站邮件(到端口25)。

答案 1 :(得分:0)

我发现问题,当您输入电子邮件时,大约五分钟后您会收到一封安全电子邮件,内容是关于试图访问的安全性较低的应用程序,即VBS脚本,您点击启用安全性较低的应用访问权限,然后就可以了。