发送带有midi文件的HTML电子邮件,该文件需要在打开时自动播放

Rol*_*and -1 html php midi html-email phpmailer

我正在尝试完成以下操作,我正在使用PHP Mailer发送HTML电子邮件,该文件读取html文件并在HTML文件中嵌入midi文件,然后发送电子邮件,然后midi文件应自动开始播放一旦打开电子邮件,这是可能的,因为它似乎不起作用,我正在使用Evolution来查看电子邮件.

我的代码看起来像这样,

HTML文件"如果我在浏览器中打开它,它会播放但不会在电子邮件中播放"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
    <title>Template</title>
</head>
<body>

    <h1>Song is playing</h1>
    <embed src="http://test.mydomain.co.za/song.mid" autostart="true" loop="true" hidden="true" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

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</p>\n";
     }catch (phpmailerException $e) {
       echo $e->errorMessage(); //Pretty error messages from PHPMailer
     } catch (Exception $e) {
      echo $e->getMessage(); //Boring error messages from anything else!
    }
?>
Run Code Online (Sandbox Code Playgroud)

这是可能吗?如何?

Ben*_*Ben 5

那将是世界上最烦人的电子邮件!

值得庆幸的是,大多数邮件客户端无法识别媒体标签或嵌入式闪存.