在任何邮件客户端中打开 eml 文件并截图

发布于 2024-07-24 08:11:11 字数 315 浏览 3 评论 0原文

我执行了大量创建电子邮件的测试。 我将每条消息存储在单独的 eml 文件中。 (如果需要,我可以更改文件扩展名。)

我想在任何邮件客户端中打开每个文件并拍摄屏幕截图,以便稍后可以直观地检查电子邮件。

我的想法是,我可以使用图像查看应用程序同时查看多个屏幕截图,这样我就可以直观地比较它们(每次测试运行后)。

我可以访问 Windows、Mac 和 Linux 机器。 我更希望解决方案是用 Ruby 编写的,但这不是必需的。

我正在搜索网络和这个网站,但到目前为止还没有运气。 如果我找到解决方案,我会在答案中发布解决方案。

I perform a lot of tests that create e-mail messages. I store each message in separate eml file. (I can change file extension if needed.)

I would like to open each file in any mail client and take a screen shot, so I could visually inspect e-mails later.

The idea is that I could use a image viewing application to look at several screenshots in the same time, so I could visually compare them (after each test run).

I have access to Windows, Mac and Linux machines. I would prefer if the solution is in Ruby, but that is not required.

I am searching the web and this site, but no luck so far. I will post the solution in answer if I find it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

聽兲甴掵 2024-07-31 08:11:11

您似乎无法自动化 Outlook Express。 从命令行启动时,它仅接受 newsonlymailonly 选项。

从命令行启动时 Thunderbird 接受文件名

C:\>"C:\Program Files\Mozilla Thunderbird\thunderbird.exe" mail.eml

这就是我打开一个邮件客户端中的电子邮件。

snapit.exe 拍摄屏幕截图并将其保存到文件中。

这是为多个 eml 文件截取屏幕截图的脚本。

file_names.each do |file_name|
  `start /d "#{thunderbird_folder}" thunderbird.exe #{file_name}`

  # if the script does not wait for a second, screen shot will be taken before
  # thunderbird opens
  sleep 1

  `snapit.exe`
end

Looks like you can not automate Outlook Express. It accepts only newsonly and mailonly options when started from command line.

Thunderbird accepts file name when started from command line:

C:\>"C:\Program Files\Mozilla Thunderbird\thunderbird.exe" mail.eml

That was all I needed to open an e-mail in a mail client.

snapit.exe takes the screen shot and saves it to file.

And here is the script to take the screen shot for multiple eml files.

file_names.each do |file_name|
  `start /d "#{thunderbird_folder}" thunderbird.exe #{file_name}`

  # if the script does not wait for a second, screen shot will be taken before
  # thunderbird opens
  sleep 1

  `snapit.exe`
end
旧街凉风 2024-07-31 08:11:11

尝试使用 Selenium 截取屏幕截图

我从未尝试过,但是有多种截取屏幕截图的方法以及使用 Ruby

From 的 方法文档

capture_screenshot(filename)

Captures a PNG screenshot to the specified file.

‘filename’ is the absolute path to the file to be written, e.g. "c:\blah\screenshot.png" 

您还可以查看Page Glimpse 了解这些任务。

您需要找到一种方法来自动化“打开电子邮件/截取屏幕截图”过程。

Try using Selenium to take the screenshots

I never tried it, but there are ways to take screenshots and ways to use Ruby

From the documentation :

capture_screenshot(filename)

Captures a PNG screenshot to the specified file.

‘filename’ is the absolute path to the file to be written, e.g. "c:\blah\screenshot.png" 

You can also take a look at Page Glimpse for these tasks.

The you need to find a way to automatize the "open email / take screenshot" procedure using this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文