jkkenzie Posted January 19, 2009 Share Posted January 19, 2009 This mail function doesn't work: It sends the entire code as a message: Even if i use an html page as the conatainer of the BODY of the message: HELP. if ($FriendEmail) { //Body $mail_body ="<STYLE> .headerTop { background-color:#FFCC66; border-top:0px solid #000000; border-bottom:1px solid #FFFFFF; text-align:center; } .adminText { font-size:10px; color:#996600; line-height:200%; font-family:verdana; text-decoration:none; } .headerBar { background-color:#FFFFFF; border-top:0px solid #333333; border-bottom:10px solid #FFFFFF; } .title { font-size:20px; font-weight:bold; color:#CC6600; font-family:arial; line-height:110%; } .subTitle { font-size:11px; font-weight:normal; color:#666666; font-style:italic; font-family:arial; } td { font-size:12px; color:#000000; line-height:150%; font-family:trebuchet ms; } .sideColumn { background-color:#FFFFFF; border-left:1px dashed #CCCCCC; text-align:left; } .sideColumnText { font-size:11px; font-weight:normal; color:#999999; font-family:arial; line-height:150%; } .sideColumnTitle { font-size:15px; font-weight:bold; color:#333333; font-family:arial; line-height:150%; } .footerRow { background-color:#FFFFCC; border-top:10px solid #FFFFFF; } .footerText { font-size:10px; color:#996600; line-height:100%; font-family:verdana; } a { color:#FF6600; color:#FF6600; color:#FF6600; } </STYLE>"; $mail_body .=" <body leftmargin=\"0\" marginwidth=\"0\" topmargin=\"0\" marginheight=\"0\" offset=\"0\" bgcolor=\"#99CC00\"> <table width=\"100%\" cellpadding=\"10\" cellspacing=\"0\" bgcolor=\"#99CC00\" > <tr> <td valign=\"top\" align=\"center\"> <table width=\"600\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td align=\"center\"><span>Email not displaying correctly? <a href=\"*|ARCHIVE|*\">View it in your browser.</a></span></td> </tr> <tr> <td align=\"left\" valign=\"middle\" ><center><a href=\"\"><IMG id=editableImg1 SRC=\"images/mailbanner.gif\" BORDER=\"0\" title=\"Your Company\" alt=\"Your Company\" align=\"center\"></a> </center></td> </tr> </table> <table width=\"600\" cellpadding=\"20\" cellspacing=\"0\" bgcolor=\"#FFFFFF\"> <tr> <td bgcolor=\"#FFFFFF\" valign=\"top\" width=\"400\" style=\"font-size:12px;color:#000000;line-height:150%;font-family:trebuchet ms;\"> <p> <span>Hello!, __FRIENDNAME__,</span><br> <span >by __SENDERNAME__</span><br> __TEXT__ </p> <p> <span >Bible Breaking News</span><br> <span >by BBN</span><br> This email is not spam. Your friend __SENDERNAME__ invited you from IP address: __IP__ You can subscribe to our Bible Breaking News Letters by following the link at the bottom of this email message. http://www.biblebreakingnews.com/mails/subscribe.php?email=__FRIENDEMAIL__ We appreciate you taking time to read out message and you are most welcome to join BBN NEWS and even contribute your news item. </p> </td> <td width=\"200\" valign=\"top\" > <span > <span >Grooming Tips:</span><br> Tick picking novice? Lorem ipsum dolor sit amet, <a href=\"#\">consectetuer adipiscing elit</a>. Sed at erat. Phasellus condimentum. Nullam sed magna. Donec quis tellus in neque congue porttitor. Proin sit amet ligula id leo porta rutrum. <br> <br> <span >Waterhole Dangers</span><br> Watery oasis, or crocodilian cesspool from hell? As the dry season approaches, lorem ipsum dolor sit amet, <a href=\"#\">consectetuer adipiscing elit</a>. Sed at erat. Phasellus condimentum. Nullam sed magna. Donec quis tellus in neque congue porttitor. Proin sit amet ligula id leo porta rutrum. </span> </td> </tr> </table> </td> </tr> </table> </body>"; $mail_body = str_replace('__TEXT__',$emailtext,$mail_body); $mail_body = str_replace('__FRIENDNAME__',$FriendName,$mail_body); $mail_body = str_replace('__SENDERNAME__',$Name,$mail_body); $mail_body = str_replace('__FRIENDEMAIL__',$FriendEmail,$mail_body); $mail_body = str_replace('__IP__',$_SERVER['REMOTE_ADDR'],$mail_body); $mail_body= stripslashes($mail_body); //Subject $subject="Message from".$Name; // Headers $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: ".$Name." <".$Email.">\r\n"; $headers .= "To: ".$FriendName." <".$FriendEmail.">\r\n"; mail( $FriendEmail, $subject, $mail_body, $headers); } Link to comment https://forums.phpfreaks.com/topic/141448-mail-function/ Share on other sites More sharing options...
trq Posted January 19, 2009 Share Posted January 19, 2009 If your planning on sending html documents, its probably best to validate those documents first. Link to comment https://forums.phpfreaks.com/topic/141448-mail-function/#findComment-740379 Share on other sites More sharing options...
jkkenzie Posted January 20, 2009 Author Share Posted January 20, 2009 Well , i dont understand to validate the html document? I dont have an idea about that. Link to comment https://forums.phpfreaks.com/topic/141448-mail-function/#findComment-740970 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.