~n[EO]n~ Posted November 4, 2007 Share Posted November 4, 2007 Hi all, I had made HTML mail, it is working fine the mail gets received, but when I open the mail in Yahoo and Hotmail, images are missing and CSS also doesn't load. do you guys have any idea, why the images and css is not loading ??? Link to comment https://forums.phpfreaks.com/topic/75981-html-mail-images-and-css-not-loading-in-yahoo-and-hotmail/ Share on other sites More sharing options...
~n[EO]n~ Posted November 4, 2007 Author Share Posted November 4, 2007 'bump' -ed Link to comment https://forums.phpfreaks.com/topic/75981-html-mail-images-and-css-not-loading-in-yahoo-and-hotmail/#findComment-384659 Share on other sites More sharing options...
bwochinski Posted November 4, 2007 Share Posted November 4, 2007 Can you paste the HTML? Or if it's long, just the relevant tags would be good. Link to comment https://forums.phpfreaks.com/topic/75981-html-mail-images-and-css-not-loading-in-yahoo-and-hotmail/#findComment-384663 Share on other sites More sharing options...
~n[EO]n~ Posted November 4, 2007 Author Share Posted November 4, 2007 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 https://forums.phpfreaks.com/topic/75981-html-mail-images-and-css-not-loading-in-yahoo-and-hotmail/#findComment-384671 Share on other sites More sharing options...
bwochinski Posted November 4, 2007 Share Posted November 4, 2007 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 https://forums.phpfreaks.com/topic/75981-html-mail-images-and-css-not-loading-in-yahoo-and-hotmail/#findComment-384672 Share on other sites More sharing options...
~n[EO]n~ Posted November 4, 2007 Author Share Posted November 4, 2007 Ok, thanks I will try. Link to comment https://forums.phpfreaks.com/topic/75981-html-mail-images-and-css-not-loading-in-yahoo-and-hotmail/#findComment-384674 Share on other sites More sharing options...
~n[EO]n~ Posted November 5, 2007 Author Share Posted November 5, 2007 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 https://forums.phpfreaks.com/topic/75981-html-mail-images-and-css-not-loading-in-yahoo-and-hotmail/#findComment-384743 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.