Jump to content

Run code in email


brentman

Recommended Posts

Ideally my goal is to run php code in emails.... It needs to be a solution that will work with at least one major email client, ie gmail, yahoo.

 

iframes work in many of the non popular clients but do not work in gmail and does not work in yahoo as far as I know.

 

I can't create the correct content on email send because people don't open their email right away so the content will need to change to be correct when they open it.

 

I was thinking about doing something with <img width="300px" height="300px" src="blahblahmyserver.php"> to do this but I am not quite sure if I am going down the wrong path here. When I try it with just a domain it displays a broken image.

 

If I could pop open a window on email open (or even acceptance of images) i could display the content that way.

 

Any ideas on how to accomplish this would be helpful. There has to be some way Thanks!

Link to comment
Share on other sites

The best you can do is reference a dynamically generated image, as mentioned in your first post, and also include a "Can't read this email? Click here" link. Most email clients disallow by default anything that would require an external request (such as loading an image) because it's a common way for spammers to verify if an email is real or not. Your recipients would have to configure their clients to allow your image to be displayed, or just click the link to go to the webpage version of your email.

Link to comment
Share on other sites

@kicken: Can you elaborate on the dynamically generated image? That could be something I could work with but I am not quite sure what you mean.

 

Even though most images are blocked by default, enough people load the images that it would be an acceptable solution for what I am doing.

Link to comment
Share on other sites

Basically all you do is send a HTML Email that contains an image tag, eg:

<html><body><img src="http://example.com/image.php"></body></html>
Then you have your image.php script generate whatever content you want them to see as an image using the GD functions.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.