【发布时间】:2021-06-30 15:01:28
【问题描述】:
我需要在通过 Perl 脚本发送的电子邮件中获取进度条。
下面是我用过的 JS fiddle 链接。尽管在浏览器中可见,但它不会在电子邮件中显示进度条。
http://jsfiddle.net/dw34m2j7/1/
这里是 Perl 代码 sn-p。
use MIME::Lite;
use strict;
my $mail_body = "";
$mail_body = "
<html lang='en'>
<head>
<title>Bootstrap Example</title>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css'>
</head>
<body>
<div class='container'>
<h2>Progress Bar With Label</h2>
<div class='progress'>
<div class='progress-bar' style='width:80%'>80%</div>
</div>
</div>
</body>
</html> ";
my $msg = MIME::Lite->new(
From => "me\@do-not-reply",
To => "abc\@outlook.com",
Subject => "TEST EMAIL",
Type => 'multipart/mixed'
);
$msg->attach(
Type => 'text/html',
Encoding => 'quoted-printable',
Data => $mail_body,
);
$msg->send;
我什至使用了一个逻辑来创建进度条,没有 JS 和 Bootstrap,只使用 HTML 和 CSS。
请在下面的链接中找到代码。
让我知道一种通过 Perl 的电子邮件发送此进度条的方法。
【问题讨论】:
-
Outlook 和大多数其他邮件客户端不会包含外部样式表或图像(至少在未经用户批准的情况下不会)。尝试嵌入样式表。
标签: html css html-email