vbscript 中的远程 SMTP (Google) 通过 iMacros 发送电子邮件
我正在使用 iMacros Web 测试工具的脚本版本,我只是希望你们了解它。每次 iMacros 在播放过程中遇到错误时,我都会尝试使用 Google SMTP (smtp.gmail.com) 端口 465 通过 vbscript 发送电子邮件。但是,每次运行脚本时,都会出现此错误
sendusing 配置值无效
我已经尝试了一些已知的修复程序,但这仍然是一个问题。脚本如下:
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[电子邮件受保护]"
myMail.To="[电子邮件受保护]"
myMail.TextBody="这是一条消息。"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'远程 SMTP 服务器的名称或 IP
myMail.Configuration.Fields.Item _
("http:// /schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.gmail.com"
'服务器端口
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport ")=465
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
我正在使用 Windows7 Home Premium。和最新版本的 iMacros。我希望任何人都可以伸出援手。太感谢了。
I'm using the Scripting Edition of iMacros web testing tool, I just hope that you know it guys. And I'm trying to use the Google SMTP (smtp.gmail.com) port 465 to send an email via vbscript each time iMacros encountered error during playback. However, each time I run the script, it's giving me this error
the sendusing configuration value is invalid
I've already tried some known fixes but it's still an issue. Here's the script:
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.TextBody="This is a message."
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.gmail.com"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=465
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
I'm using the Windows7 Home Premium. and latest version of iMacros. I hope anyone could lend a hand. Thank you so much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用 SMTP 端口 587。这就是我在 C# 程序中使用的。
Try using port 587 for the SMTP. That's what I use in my C# program.
要使用 googles smtp 服务器,您必须提供用户名和密码才能连接,因为它不是匿名 smtp 服务器。我有一个 Google Apps Premier 帐户,我用它来转发消息。我不确定谷歌是否允许在普通的谷歌邮件帐户上转发邮件。
To use googles smtp server you must supply a user name and password to connect with as it's not an anonymous smtp server. I have a Google apps premier account which I use to relay messages through. I'm not sure if Google allow mail relay on a normal googlemail account though.