【发布时间】:2016-10-31 11:22:18
【问题描述】:
我正在使用带有条形码的 html2canvas 使用以下函数将动态图像制作到特定的 div
$(function() {
$("#btnSave").click(function() {
html2canvas($('#printableArea'), {
onrendered: function(canvas) {
var img = canvas.toDataURL()
window.open(img);
}
});
});
});
图像在 base64 中打开到新的 winodw 我的问题是我想将图像发送到客户端邮件进行打印。 每个客户的图像都会相应地变化并且是特定的
我的php文件是
<?php
include("auth.php");
//message
$message = $_POST['msg'];
$username =$_REQUEST['username'];
$surname =$_REQUEST['surname'];
$name= $_REQUEST['name'];
//mail body - image position, background, font color, font size...
$body = "Dear $surname $name
Thank you for your Pre-registration for Global.
Please print the attached e-ticket with your personal barcode and bring it to the reception of the exhibition.
This barcode includes data about you which is required during registration. Having this barcode will considerably speed up the registration process
Organizing committee.\n".
$body = "Print e-ticket
(http://panosmoustis.netai.net/barcodeimage/E-ticket_2016.pdf) .\n".
$headers='MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html;charset=iso-8859-1' . "\r\n";
$headers .= 'From: <http://panosmoustis.netai.net/>' . "\r\n";
$to = $_POST['mail'];
$subject = "EXPRESS REGISTRATION (Global)";
//mail function
$email = mail($to, $subject, $body, $headers);
if(!$email) {
echo "Error sending email";
} else {
echo "Your email was sent successfully.";
}
?>
谢谢
【问题讨论】:
-
那么问题是什么?见How to Ask
-
我的问题是我想将图像发送到客户端邮件进行打印。
-
你应该使用 PHPMailer,它让附件变得非常简单
-
@Zanderwar 当然...但是您知道 OP 是否甚至可以到达那里...不。具体问题没有提到。这就是要求 OP 提供适当的问题描述的意义......不仅仅是一个目标
-
这是一个目标...不是与实现目标的代码相关的问题。这不是一个教程服务,问题需要定义一个特定代码相关问题
标签: javascript php html html-email