gpt4 book ai didi

testcomplete - 使用 TestComplete 回复电子邮件

转载 作者:行者123 更新时间:2023-12-01 04:01:50 25 4
gpt4 key购买 nike

我正在努力寻找一种简单的方法来使用 TestComplete 回复收件箱中的电子邮件。

目前我正在使用的代码可以在这里找到 http://support.smartbear.com/viewarticle/9022/在 JScript 部分下。

我已经设法根据正文和主题创建并发送电子邮件以模拟回复。然而,这还不够,因为我正在测试的软件需要有一个真正的回复,以将其链接到之前发送的消息以将其放置在正确的用户邮箱中。

任何帮助将不胜感激。如果您需要更多信息,请询问。

最佳答案

您应该能够做到这一点,而不会出现通过 COM 使用 Outlook 的问题。我已经修改了您提到的文章中的示例,以演示如何执行此操作。

function Test()
{
Log.Message(replyToMessage2010("account name", "sender email", "Test 1234321", "This is a reply"));
}

function replyToMessage2010(accountName, senderEMail, eMailSubject, replyText)
{
var OutlookApplication = Sys.OleObject("Outlook.Application");
var NamespaceMAPI = OutlookApplication.GetNamespace("MAPI");

// Check whether the specified account exists:
if (NamespaceMAPI.Accounts.Item(accountName) != null)
{
NamespaceMAPI.SendAndReceive(false);

// Get the "Inbox" folder
var inbox = NamespaceMAPI.Folders(accountName).Folders("Inbox");
var items = inbox.Items;
for (var i = 1; i < items.Count + 1; i++)
{
if (items.Item(i).Subject == eMailSubject &&
items.Item(i).SenderEmailAddress == senderEMail && items.Item(i).UnRead)
{
var reply = items.Item(i).ReplyAll();
reply.Body = replyText + reply.Body;
reply.Send();
return true;
}
}
return false;
} else
{
OutlookApplication.Quit();
return false;
}
}

关于testcomplete - 使用 TestComplete 回复电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13033204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com