***** ONLY ONE POST PER QUESTION. DO NOT DOUBLE POST. ****
Is there any way of email tracking or sending dynamic emails?
What i mean is > if i want to send a php code in an email such
that whenever the user opens the email he sees the CURRENT DATE
AND TIME.
Or When i post a newsletter, i should get to know the email id
if not then atleast the ip addresses and the number of people
till now who have opened the mail. That means whenever someone
opens an email, the counter should be incremented and displayed
on the email itself or on my server
I want to send php function/code in the email which executes
as it does on my server and not just display the code as text part of the mail
If I have $value=6++;
then if i write echo $value;
It should print 6 on the email for the first time and then increment
and show 7, 8... whenever that mail is opened next..
Email Tracking/Dynamic Emails?
Moderator: General Moderators
It's not really possible unless you do it in some sort of hackish way. Such as images.
Then again, a lot of mail programs have images off (even by default) and a lot of people don't accept HTML emails.
Code: Select all
<img src="http://www.example.com/script.php?emailId=1" />Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
I got the point that if the email is html formatted then i can do the above thing. But not getting how to implement script.php?email=number part. can you give more details or better share a code similar to it's functionality. I want to track the email ids and ip who have read the newsletter and at what time?scottayy wrote:It's not really possible unless you do it in some sort of hackish way. Such as images.
Then again, a lot of mail programs have images off (even by default) and a lot of people don't accept HTML emails.Code: Select all
<img src="http://www.example.com/script.php?emailId=1" />
It'd just be a script that records the id from the $_GET array and the IP from $_SERVER. You're wasting your time though, I reckon as few as 10% of people view images in emails. No major mail clients or web mail services display them automatically. Any records you get are going to be completely inadequate. Accurately tracking email is impossible.kkonline wrote: I got the point that if the email is html formatted then i can do the above thing. But not getting how to implement script.php?email=number part. can you give more details or better share a code similar to it's functionality. I want to track the email ids and ip who have read the newsletter and at what time?
The best way forward is to send the user a very vague email that tempts them to your website via a special link or URL. Then you can track the pageviews in the normal way.
I used the following code for email.php.
and when i wrote http://mysite.com/track/email.php?userid=111
I got the image but no entry in the database ? What could be the reason?
also is there any way i can increment the userid on it's own rather than sending userid=1 to 1st email and userid=2 to second email if i have around 100 emails; i just want an entry in the data base how all the id's that have viewed?
and when i wrote http://mysite.com/track/email.php?userid=111
I got the image but no entry in the database ? What could be the reason?
Code: Select all
<?php
$con = mysql_connect("localhost","user","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("sqldb", $con);
$userid = $_GET['userid'];
$sql="INSERT INTO quote (contributed_by)
VALUES
('$_GET[userid]')";
mysql_close($con);
?>
<img src="http://mysite.com/gallery/mj_1.jpg">- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
lack of mysql_query is why it didnt input into the database.
To make it automatically count up, you would first have to select from the database, use $userid++ (or similar) and then insert the new data.
To make it automatically count up, you would first have to select from the database, use $userid++ (or similar) and then insert the new data.