ask9 Posted April 19, 2010 Share Posted April 19, 2010 Hello guys i'm trying to incorporate a video from youtube.com inside my email content. but it doesn't work. here is the codes below, <?php require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPAuth = false; $mail->Username = “contact+coder9.com”; $mail->Password = “mypasswordhere”; $mail->Host = "localhost"; // SMTP server $mail->From = "[email protected]"; $mail->AddAddress("[email protected]"); $mail->Subject = "first mail"; $mail->Body = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <title>Untitled Document</title> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> </head> <body> <table width='600' height='522' border='0' cellspacing='0'> <tr> <td height='100' bgcolor='#FF0000'><div align='center'><img src='http://coder9.com/odesk/email/images/banner.jpg' alt='' name='bannerholder' width='600' height='100' id='bannerholder' /></div></td> </tr> <tr> <td height='393' bgcolor='#000000'><div align='center'><object width='560' height='340'><param name='movie' value='http://www.youtube-nocookie.com/v/pIv7fdbqZgk&hl=en_US&fs=1&rel=0'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube-nocookie.com/v/pIv7fdbqZgk&hl=en_US&fs=1&rel=0' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='560' height='340'></embed></object></div></td> </tr> <tr> <td height='100'><div align='center'><img src='images/flowers.jpg' alt='' name='holderflower' width='116' height='116' id='holderflower' /></div></td> </tr> </table> </body> </html>"; $mail->WordWrap = 50; if(!$mail->Send()) { echo "Message was not sent"; echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent"; } ?> i hope someone can help me. thanks in advance. Link to comment https://forums.phpfreaks.com/topic/199001-incorporating-video-in-the-email-message/ Share on other sites More sharing options...
JustLikeIcarus Posted April 19, 2010 Share Posted April 19, 2010 First thing you need to do is use the $mail->MsgHTML($body) to tell phpmailer you are generating an html body. This method does some automated handling of embeded objects. Link to comment https://forums.phpfreaks.com/topic/199001-incorporating-video-in-the-email-message/#findComment-1044601 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.