Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9023023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:39:45+00:00 2026-06-16T05:39:45+00:00

I’m playing with the idea of adding email tracking to a web service I

  • 0

I’m playing with the idea of adding email tracking to a web service I built for a small client business. I was planning on doing the embedded image solution (with reference to an image on my server) – unless someone else has a better method – but when I use the image tag referencing a PHP page on my server it loads the “broken image” icon. How can I make this a valid image?

Here is the code for the mailing PHP page:

<?php
   $body = "<html>Hello there!".
    "<img src='http://mysite.com/track.php?name=bob' />".
    "</html>";

    $subject = "Tracking on ".date('Y-m-d H:i:s');

    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= 'From: webmaster@mysite.com' . "\r\n";

    mail('my_email@gmail.com',$subject,$body,$headers);
?>

And here is the tracking code:

<?php
   include('database_connection.php');
   $query = "INSERT INTO tracking SET name='".$_GET['name']."', date=NOW()";
   mysql_query($query);

   // Tried this, but it doesn't work:
   echo "<img src='http://mysite.com/photos/image.jpg'>";
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:39:47+00:00Added an answer on June 16, 2026 at 5:39 am

    If you’re going to use a PHP script like that, it needs to return image data, not just a HTML image tag. Easiest way to do that will be something like:

    <?php
    header("Content-Type: image/jpeg");
    readfile("image.jpeg");
    
    do_all_your_tracking_stuff();
    

    Note that this is returning the image data first, so that a mail client can start displaying it immediately, rather than waiting for your SQL queries to complete.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm interested in microtypography issues on the web. I want a tool to fix:
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I have an array which has BIG numbers and small numbers in it. I
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.