Forum Moderators: coopster

Message Too Old, No Replies

HTML email

problems linking to an external image

         

nquinn

10:08 pm on Aug 10, 2004 (gmt 0)

10+ Year Member



Hi all,

I'm having problems linking to an external image in my email.

I'm using PHP to setup the headers as shown below.
$htmldata is pulled from a mysql database, where the html is stored directly.
the image is referenced as follows:
<img src="http://www.(domain).com/i/image.jpg">

However, the image breaks. Any ideas? Addslashes() causing problems? Something else?


$to = $email;
$subject = $mailsubject;
$slashdata = addslashes($htmldata);
$message = "<a href=\"http://www.(domain).com/smart/enduser.php?c=$campno\">Request information</a>\n";
$message .= "$slashdata";
$message .= "<a href=\"http://www.(domain).com/smart/enduser.php?c=$campno\">Request information</a>\n";

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "To: $email\r\n";
$headers .= "From: $distname <$distemail>\r\n";
mail($to, $subject, $message, $headers);

dreamcatcher

10:16 pm on Aug 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When pulling the data from the database you should be looking at stripslashes not addslashes.

Also pop the newline syntax at the end of your message line:

$message .= "$slashdata\n";