UnknownPlayer Posted January 28, 2012 Share Posted January 28, 2012 I have a problem, i have page to send via mail function, cant snd html page, when recive mail, there is no layout, but text is there, also there are no images, and i put full address to image file. Using content type html/text, and still nothing :-( Can someone help me? Quote Link to comment https://forums.phpfreaks.com/topic/255944-email-send-html-page/ Share on other sites More sharing options...
Pikachu2000 Posted January 28, 2012 Share Posted January 28, 2012 The problem is on line 112. Quote Link to comment https://forums.phpfreaks.com/topic/255944-email-send-html-page/#findComment-1312020 Share on other sites More sharing options...
UnknownPlayer Posted January 28, 2012 Author Share Posted January 28, 2012 This is my code: <?php $name = $_POST['name']; $email = $_POST['email']; $years = $_POST['years']; $birthdate = $_POST['birthdate']; $applydate = date('Y-m-d'); $subject = "Birthday Surprise"; $headers = "From: birthday@example" . "\r\n"; $headers .= "Reply-To: birthday@example" . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message = ' <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> body{ margin:auto; font-family:"HelveticaNeue-Roman"; font-weight:normal; font-size:16px; background:#ccc; } @font-face{ font-family:"Helvetica Neue Bold"; src:url("'.SITE_URL.'fonts/HelveticaBold.ttf"); } @font-face{ font-family:"HelveticaNeue-Roman"; src:url("'.SITE_URL.'fonts/HelveticaBold.ttf"); } @font-face{ font-family:"Helvetica Neue Light"; src:url("'.SITE_URL.'fonts/HelveticaLight.ttf"); } #wrapper{ width:520px; height:auto; margin:20px auto 0 auto; padding:0; background:#FFF; border-top:solid 5px #F00; border-bottom:solid 5px #F00; } #one{ height:180px; border-left:solid 5px #F00; border-right:solid 5px #F00; padding:10px 0; } #two{ border-left:solid 5px #F00; border-right:solid 5px #F00; padding:10px 0; } #logo{ width:113px; height:48px; background:url('.SITE_URL.'images/logo.gif); margin:auto; } #txt{ color:#F00; text-align:center; margin:10px; padding:0; font-family: } #txt p{ font-size:22px; font-weight:bold; margin:0; font-family:"HelveticaNeue-Roman"; } #txt h1{ text-align:center; font-size:24px; text-transform:uppercase; font-weight:bold; margin:5px 0 0 0; } #txt h2{ text-align:center; font-size:32px; text-transform:uppercase; font-weight:bold; margin:5px; } #pic{ width:169px; height:28px; background:url('.SITE_URL.'images/txt_11.png); margin:15px auto; } #pic1{ width:520px; height:216px; background:url('.SITE_URL.'images/img5.jpg); margin:auto; } #pic2{ width:317px; height:440px; background:url('.SITE_URL.'images/txt_7.png); margin:auto; } #footer{ height:50px; background:#FFF; clear:both; } #footer_logo{ width:165px; height:33px; background:url('.SITE_URL.'images/logo2.png); margin:10px auto 0 auto; } </style> </head> <body> <div id="wrapper"> <div id="one"> <div id="logo"></div> <div id="txt"> <p>Hope to see you for your '.$years.' th</p> <div id="pic"></div> </div> </div> <div id="pic1"></div> <div id="two"> <div id="pic2"></div> <div id="footer"> <div id="footer_logo"></div> </div> </div> </div> </div> </body> </html> '; mail($email, $subject, $message, $headers); ?> Can you help me please? Quote Link to comment https://forums.phpfreaks.com/topic/255944-email-send-html-page/#findComment-1312069 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.