Web Hosting Talk







View Full Version : images cant be shown in mail


xtsy
09-20-2004, 06:50 AM
This is a code of mailing list , it works fine but doesnot display the images in HTML Format.It shows all the tables but no Images.Please help this is urgent.Thanks in advance

The following HTML Code was done to send email.


<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td><img src="http://www.domain.com/image.gif" width="175" height="45"></td>
</tr>
</table>
_____________________________________________
Here is the code that process the mailing in Mailing list


________________________________________________
$headers = "From: $company_name <$contact_email>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\n";
$headers .= "X-Mailer: PHP \n";
$message = "$htmlbody<br><br><br><br><br><br><br><br><br><br><br><br>";
$optoutlink = "$path";
$optoutlink .= '/unsubscribe.php?action=unsub&email=';
$optoutlink .= "$email";
$message .= "<font color=#646464 size=2 face=arial>$optoutmessage</font><br>";
$message .= "<font size=2 face=arial><a target=\"_blank\" href=$optoutlink>Unsubscribe<a></font><br>";
mail($email, $subject, $message, $headers);
print "$header<br><br><center><font color=#FFFFFF size=3>An email was succesfully sent to $email!</font></center>";
exit;
}
__________________________________________________

Rich2k
09-20-2004, 10:33 AM
What email client are you using, some of the latest email and web mail clients automatically remove images from HTML emails unless you tell them otherwise.

xelav
09-20-2004, 02:06 PM
try to send iamges as attached files and link on them

Rich2k
09-20-2004, 02:11 PM
To clarify that, read up on the MIME RFC's about embedding images in emails.

xtsy
09-21-2004, 12:51 AM
Thank you Guys

I am using Neomail , I tried yahoo too and setup as show html, also hotmail but none of them show image.

Burhan
09-21-2004, 03:17 AM
Is the message showing up as HTML?

You should also end your headers with \r\n not \n

Rich2k
09-21-2004, 04:55 AM
Originally posted by fyrestrtr
Is the message showing up as HTML?

You should also end your headers with \r\n not \n

Actually that depends on what you are using to send it.

If you are using PHP's internal mail() functions it actually converts it for you, so if you using unix/linux you should use \n only and let PHP do the work of converting the \n to \r\n but if you are going to use SMTP directly you must use \r\n as a line ending.

armstrongecom
09-21-2004, 09:36 AM
Also, be sure that when you're coding html for email, that you change all the equal signs to =3D

In email, an = means the same thing as a % in a URL... the software thinks it's a signal that the following 2 characters will be a hexadecimal code for another character. So to have an = mean just an =, you need to make it =3D, which is the hex for =.

As an example, this line...
<img src="http://www.domain.com/image.gif" width="175" height="45">

Would need to be coded like this...
<img src=3D"http://www.domain.com/image.gif" width=3D"175" height=3D"45">

HTH... -Allen

Rich2k
09-21-2004, 10:04 AM
This isn't quite correct. That only applies if any character in the HTML is outside the US-ASCII character set.

If it is then you need to take the HTML string and convert it to what is called 'quotedprintable' format.

If you have the IMAP extensions installed you can use the imap_8bit() function (http://uk.php.net/manual/en/function.imap-8bit.php)