brentman Posted October 19, 2013 Share Posted October 19, 2013 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! Quote Link to comment https://forums.phpfreaks.com/topic/283097-run-code-in-email/ Share on other sites More sharing options...
vinny42 Posted October 19, 2013 Share Posted October 19, 2013 Why don't you just email a link? :-) Quote Link to comment https://forums.phpfreaks.com/topic/283097-run-code-in-email/#findComment-1454534 Share on other sites More sharing options...
brentman Posted October 19, 2013 Author Share Posted October 19, 2013 Well yes but I am already doing that. So basically anything other than clicking a link. Quote Link to comment https://forums.phpfreaks.com/topic/283097-run-code-in-email/#findComment-1454536 Share on other sites More sharing options...
vinny42 Posted October 19, 2013 Share Posted October 19, 2013 Well I guess you're stuck, mail clients specifically try to prevent this kind of things from being done, to stop spammers and hackers from loading malicious content. Quote Link to comment https://forums.phpfreaks.com/topic/283097-run-code-in-email/#findComment-1454539 Share on other sites More sharing options...
kicken Posted October 19, 2013 Share Posted October 19, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/283097-run-code-in-email/#findComment-1454546 Share on other sites More sharing options...
brentman Posted October 20, 2013 Author Share Posted October 20, 2013 @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. Quote Link to comment https://forums.phpfreaks.com/topic/283097-run-code-in-email/#findComment-1454629 Share on other sites More sharing options...
kicken Posted October 20, 2013 Share Posted October 20, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/283097-run-code-in-email/#findComment-1454639 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.