Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email 如何使用VBS发送垃圾邮件_Email_Vbscript - Fatal编程技术网

Email 如何使用VBS发送垃圾邮件

Email 如何使用VBS发送垃圾邮件,email,vbscript,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

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

无法连接到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

非常感谢您的帮助。

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

telnet smtp.gmail.com 465 如果访问被阻止,则在超时后,您应获得如下输出:

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

像这样的工具可能会进一步了解数据包被阻止的位置


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

我发现了问题,当您输入电子邮件时,大约五分钟后,您会收到一封关于尝试访问不太安全的应用程序(即VBS脚本)的安全电子邮件,您单击启用不太安全的应用程序访问,然后它就工作了。

我收到了不同的错误:邮件无法发送到SMTP服务器。传输错误代码为0x80040217。服务器响应不可用