Jump to content

HTML mail, images and CSS not loading in Yahoo and hotmail


~n[EO]n~

Recommended Posts

Ok,

Here it is

 

<?php
$to=$_REQUEST['mem_email'];
// subject
$title="Your Registration Information";
$mail=new PHPMailer;
// here is the message part with the design 
// it has all the images in the td, table etc... 
// it is too long so i didn't keep here only some portions 
$message = '<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<td width="900" height="481" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                <!--DWLayoutTable-->
                <tr>
                  <td width="900" height="256" align="center" valign="top"><img src="images/mail_big.jpg" width="494" height="481" /></td>
                </tr>
              </table>              </td>
';
// header for html
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$success=$mail->sendmail($to,$title,$message,$headers);

?>

 

That's all , the mail gets send but the images are not coming...

 

Thanks...

Well, I don't seen any CSS referenced there, but the problem with your images is that you have to use full pathnames, relative pathnames wont work if the page isn't being browsed from your server.

 

<img src="http://www.yoursite.com/images/mail_big.jpg" width="494" height="481" />

Well, the images part worked, but CSS is not loading how to make the CSS appear too...

I added this line in message part

 

$message = '<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="http://www.mysite.com/css/hello.css" rel="stylesheet" type="text/css" />
</head>

			<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">

 

Will this work ???

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.