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...

Link to comment
Share on other sites

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" />

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.