我正在尝试完成以下操作,我正在使用PHP Mailer发送HTML电子邮件,该文件读取html文件并在HTML文件中嵌入midi文件,然后发送电子邮件,然后midi文件应自动开始播放一旦打开电子邮件,这是可能的,因为它似乎不起作用,我正在使用Evolution来查看电子邮件.
我的代码看起来像这样,
HTML文件"如果我在浏览器中打开它,它会播放但不会在电子邮件中播放"
TemplateSong is playing
PHP邮件代码
$email = $_GET['email'];
//Including the PHP mailer class
require_once 'class.phpmailer.php';
$mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch
try {
$mail->AddAddress($email);
$mail->SetFrom('webmaster@mydomain.co.za', 'Webmaster');
$mail->AddReplyTo('webmaster@mydomain.co.za', 'Webmaster');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('template.html'));
$mail->Send();
echo "Message Sent OK
\n";}catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
这是可能吗?如何?