Embedding FLV In Email

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
tsheppard
Forum Newbie
Posts: 3
Joined: Thu Jun 26, 2008 1:11 pm

Embedding FLV In Email

Post by tsheppard »

Yeah I know ... this may be impossible, but there are companies out there that are charging ridiculous amount of money to provide this as a service, so I know it's not completely impossible.

I've tried several methods for this including using a traditional embed tag like you'd get with a YouTube video, using an iframe in the email to present the video remotely, and javascript, and all of these work perfectly on Mac Mail, but since forcing everyone to buy a Mac is really not available, perhaps there's another solution.

On Windows it seems that for some reason the video will not be downloaded when the email is opened. If an end user has visited the video online and has it cached, then returns to the email where it's embedded, it will then play perfectly, but not unless it's been cached by a browser first.

I would think that using the Embed feature in Swift would create an email that would be too large to send, so I'm kinda stuck.

Ideally what would be great would be just an image placeholder, a screenshot of the video and player, that when clicked would then download and swap the video and player for the placeholder WITHOUT taking them into a browser window. That way you're not actually increasing the size of the email, and it's less intrusive, if they don't want to watch it they just don't click it.

I'm wondering if something like this is possible with SwiftMailer or in any other way.

I'd love to get some ideas. I know flash in email is something that marketers have been working on for years and I've yet to see a non-commercial piece of code that can do this cross platform. I know no matter what you use not everyone will be accepting html email, and that's fine, but it would be lovely to have a solution that works across all platforms for those that do.

I'd really love to hear some thoughts and suggestions for this please, or if someone can point me in the direction of a solution that I may have missed that would be awesome too.

Thanks and warmest regards to all.

Tai
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Embedding FLV In Email

Post by Kieran Huggins »

You can embed crap in e-mail to your heart's content, but it won't ever show up for the user.

Mail clients don't have Flash, and webmail providers sanitize the hell out of rich e-mail so it doesn't break their layouts.

Also, you'll be tagged as spam in most cases anyway.

My advice: rethink the problem, fundamentally.
tsheppard
Forum Newbie
Posts: 3
Joined: Thu Jun 26, 2008 1:11 pm

Re: Embedding FLV In Email

Post by tsheppard »

A couple things there.

1. Email clients utilize the flash support of the default browser to display flash. As I said, if the video is cached in Windows by the browser it displays fine, in Mac it ALWAYS displays perfectly cached or not.

2. The spam score for an embedded plugin is 3/10ths of a point, which is nothing. So you're mistaken there as well.

As I said, I would prefer this just be an image that would be swapped for the video on click, not the actual video in the email.

Thanks for your reply.

Tai
tsheppard
Forum Newbie
Posts: 3
Joined: Thu Jun 26, 2008 1:11 pm

Re: Embedding FLV In Email

Post by tsheppard »

A couple things there.

1. Email clients utilize the flash support of the default browser to display flash. As I said, if the video is cached in Windows by the browser it displays fine, in Mac it ALWAYS displays perfectly cached or not.

2. The spam score for an embedded plugin is 3/10ths of a point, which is nothing. So you're mistaken there as well.

As I said, I would prefer this just be an image that would be swapped for the video on click, not the actual video in the email.

Thanks for your reply.

Tai
emilyliza
Forum Newbie
Posts: 1
Joined: Wed Dec 10, 2008 2:40 pm

Re: Embedding FLV In Email

Post by emilyliza »

I have the same question. I would love to embed an image that links to a video that folks could choose (or not) to play.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Embedding FLV In Email

Post by Chris Corbyn »

Email clients don't use the Flash support of the default browser I'd just like to clarify that. They'll use whatever plugins are available for the rendering engine they implement (Gecko for Thunderbird, WebKit for Apple Mail...). If you're using a Webmail client your video will probably be stripped.

However, you can do what you need to do if you know the correct MIME type for FLV videos (I'm just going to guess at video/flv for the sake of this). I've also forgotten the <embed> attributes so this is not copy & paste code:

Code: Select all

$message->attach(new Swift_Message_Part(
  'Your email with a video: <embed src="' .
  $message->attach(new Swift_MessageEmbeddedFile(new Swift_File('/path/to/video.flv'),'video.flv',  'video/flv')) .
  '" type="video/flv"></embed>'
));
It probably won't play for the majority of your users though so I agree with Kieran, rethink what you're trying to do.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Embedding FLV In Email

Post by Kieran Huggins »

It's worse than that!

Outlook (both full-blown Outlook and Express) give you a security warning, while the rest of the major clients (standalone & web) don't even bother displaying the alternate content. The only client to actually display anyhting is Apple's Mail.app.

http://www.campaignmonitor.com/blog/pos ... h-about-1/
Post Reply