我要求在执行UFT自动化脚本时发生任何故障时向单个/多个用户发送SMS。 我使用下面的代码&将smtp服务器名称更新为我在Outlook帐户设置中找到的名称。下面的代码失败并显示错误“至少需要一个收件人但找不到任何收件人”。
请帮我解决这个问题。另请注意,由于访问限制,我无法使用任何免费的SMS API
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test Failed"
objMessage.Sender = "test@domain.com"
objMessage.To = "+91XXXXXXXXXX"
objMessage.TextBody = "Test XYZ failed at: " & Now
'Configuration information for the remote SMTP server.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "Server
name"
'Server port
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing
答案 0 :(得分:-1)