View Full Version : php in emails?
ya3
July 15th, 2005, 08:56 PM
Ok... I've had an idea.
When I send out an email, i want to know if and when the recipient opens the email. I was wondering if there was a way to implement PHP into an email. I was thinking to have it record the time and email address of the person (the latter I have no idea how to do) into a MySQL table. That'd be handy :D
I'm guessing, though, that there's an existing message-tracking service available...
I *don't* want to use receipts. No user intervention.
Thanks in advance! :cons:
SlowRoasted
July 15th, 2005, 09:01 PM
im not sure but i know it would have to depend on if the server you are sending it to has php installed.
Yeldarb
July 15th, 2005, 09:15 PM
No it wouldn't slowroasted. The key, ya3, is to display an image that is actually a php script in the file. You'd do something like:
<img src="http://www.yoursite.com/image.php?email=whatever@whatever.com" />
Then image.php would contain the code that would save the information and display the image (sending the correct headers of course). I'm not sure if you can link images like that though; and it most certainly wouldn't work with non-html enabled email clients.
ya3
July 15th, 2005, 09:22 PM
AHA!
So... would I have to do something like this:
header("Location: http://www.domain.com/image.jpg");
at the end of the PHP file?
hl
July 16th, 2005, 08:58 PM
no, it's some GD functions
image.php -
<?
header('Content-type: image/gif');
$image = imagecreatefromgif('path to gif that is 1x1, transparent');
the stuff you want to do, most likely using the GET to get the ID of the email. then you want to right stuff to the database, etc. basically it's a php file that is linked to as a gif.
?>
i know that was poor, but i think you'd understand it :)
then just put the line <img src="http://myserver.com/image.php?id=40938573490854708">
this would of course mean that the reciever must have HTML available in their email
Yeldarb
July 16th, 2005, 09:45 PM
Actually I don't think you need gd, you can include an image.
header('Content-type: image/jpg');
include("./yourimage.jpg");
hl
July 16th, 2005, 09:49 PM
Actually I don't think you need gd, you can include an image.
header('Content-type: image/jpg');
include("./yourimage.jpg");
that's true :)
gfxwhore
July 17th, 2005, 12:01 AM
AHA!
So... would I have to do something like this:
header("Location: http://www.domain.com/image.jpg");
at the end of the PHP file?
Wow! A near 2000 posts, yet you are blindidly stupid. It's amazing how much postcount (doesn't mean).
Maybe you should learn what PHP is before making such dumb statements. If you knew it was a server-side language, then you most likely wouldn't be making dumb statements unless you are super-dumb.
kirupa
July 17th, 2005, 12:11 AM
Wow! A near 2000 posts, yet you are blindidly stupid. It's amazing how much postcount (doesn't mean).
You were warned before for being derogatory towards others. Cya!
hl
July 17th, 2005, 12:37 AM
Wow! A near 2000 posts, yet you are blindidly stupid. It's amazing how much postcount (doesn't mean).
Maybe you should learn what PHP is before making such dumb statements. If you knew it was a server-side language, then you most likely wouldn't be making dumb statements unless you are super-dumb.
ya3 isn't dumb, not everyone knows PHP.
chillllllllllll
hl
July 17th, 2005, 12:37 AM
You were warned before for being derogatory towards others. Cya!
oh you banned him/her, got what was coming.
ya3
July 17th, 2005, 01:03 AM
ya3 isn't dumb
:lol:Thanks.
Wow! A near 2000 posts, yet you are blindidly stupid. It's amazing how much postcount (doesn't mean).
This here's what we call postcount-induced depression - symptoms include 'blindidly' bad grammar and aggressive tendencies... ;)
--
Oh, and thanks for the help, guys. It works :D
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.