用php发送电子邮件中的动态文本

I'm working on some dynamic content for emails and I have an idea that works for images, but not for text.

I have the following php code which what basically does, is looking for the location and reads one of the files depending on it.

 require_once('geoplugin.class.php');

 $geoplugin = new geoPlugin();

 $geoplugin->locate();

 $city = $geoplugin->city;
 $borough = $geoplugin->regionCode;

 if ($borough == 'H9') {

    readfile('http://audreyvolpert.co.uk/dynamic_image/images/UEL1.jpg');
    //readfile('http://audreyvolpert.co.uk/dynamic_image/content/header_1.txt');

 } else {

    readfile('http://audreyvolpert.co.uk/dynamic_image/images/UEL2.jpg');
    //readfile('http://audreyvolpert.co.uk/dynamic_image/content/header_2.txt');
 }

?>

In the html file I can have the following code if the file read is an image

<p><img src="http://audreyvolpert.co.uk/dynamic_image/geolocation/index.php" width="270" height="167" /></p>

Do you have an idea how I might pull text instead of an image in html?

<p>Here goes the text pulled from the php file</p>

What I want to achieve is a dynamic content for an email, therefore I can't use any php, javascript in my html.

Many thanks for any feedback

You cant use javascript, and php to display text inside email. So its impossible.

Two workarounds:

  1. Put text as dynamic image (use gd or imagick) - bad way,
  2. in e-mail, just insert url to your message

But best way is to personalize e-mail before sended.