使用HP UFT 12.02发送短信

时间:2017-05-30 17:21:51

标签: vbscript sms outlook-vba qtp hp-uft

我要求在执行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

1 个答案:

答案 0 :(得分:-1)

CDO.Message使用SMTP!

<强> SMTP

首先,您应该知道SMPT是什么以及它的立场!

SMTP是用于传输电子邮件的通信协议。通信发生在电子邮件客户端和SMTP服务器之间或两个SMTP服务器之间。 enter image description here

除了SMTP之外,还有另外两种与POP和IMAP进行电子邮件交换的协议。但是,这两个协议仅用于获取或管理电子邮件。另一方面,SMTP是一种可以接收和转发电子邮件的通信协议。

  

SMTP代表简单邮件传输协议

<小时/> 您的问题

您希望使用HP UFT发送邮件,并且您尝试使用SMTP执行此操作。但现在我们知道这是不可能的

<小时/> 答案:无法通过HP UFT发送短信。