I'm trying to accomplish the following, I'm sending a HTML email using PHP Mailer that reads a html file and embedding a midi file within the HTML file, and it then sends out the email and then the midi file should start playing automatically once the email is opened, is this possible, since it does not seem to work, I'm using Evolution to view the email.
My code looks like this,
HTML FILE "If i open this in my browser it plays but not in email"
<!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>
PHP Mailer code
$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('[email protected]', 'Webmaster');
$mail->AddReplyTo('[email protected]', '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!
}
?>
Is this at all possible? And how?