MyBB Community Forums

Full Version: HTML emails BUG
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Guys I have a problem MyBB adds <br /> tag to the end of each code line.
How to fix that?
check if that is coming from actual code used to get the email IDs (like below)
echo $row['uid'], $tab, $row['username'], $tab, $row['email']."<br />";
What do you mean where is that code?
how are you getting email IDs ? if you were using some type of php code / SQL query
then that might consist of break line code to separate the email IDs
i go to mass mail, select HTML only then add this code.
<html>
<head>
</head>
<body>
<table width="600" height="80" bgcolor="#2A4868" border="0" align="center">
  <tr>
    <td><div align="center"><span style="font-size: 50px; color:#FFF">Lets Forum.com</span></div></td>
  </tr>
</table>
<table width="500" height="80" bgcolor="#f5f5f5" align="center">
  <tr>
    <td>
    <br/>
    <div>
    <p style="margin-left:10px; margin-right: 10px; text-align:center;">
hjkhkjhkjhjkhkjhjkhjhkkjh. ghjgjjhgjhgj.f rdyryeryery.ryreryer. fghgffjfgjfgjffgjgfjfg
    </p>
    </div>
    <br/>
    </td>
    </tr>
</table>
<table width="500" height="40" bgcolor="#ff9" align="center">
<tr>
    <td><div align="center" >
<span>
<a href="http://letsforum.com" target="_blank">Login</a> |
<a href="http://letsforum.com/member.php?action=register" target="_blank">Join</a> |
<a href="http://letsforum.com/misc.php?action=help" target="_blank">Help</a> |
<a href="http://letsforum.com/misc.php?page=contact" target="_blank">Contact</a>
</span>
<br/>
 </div></td>
    </tr>
    </table>
</body>
</html>

But when the email arrives it looks like this.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=utf-8">
<head><br />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br />
<title>Untitled Document</title><br />
<style type="text/css"><br />
body {<br />
	background-color: #cbcbcb;<br />
}<br />
</style><br />
</head><br />
<body><br />
<table width="600" height="80" bgcolor="#2A4868" border="0" align="center"><br />
  <tr><br />
    <td><div align="center"><span style="font-size: 50px; color:#FFF">Lets Forum.com</span></div></td><br />
  </tr><br />
</table><br />
<table width="500" height="80" bgcolor="#FFFFFF" align="center"><br />
  <tr><br />
    <td><br />
    <br/><br />
    <div><br />
    <p style="margin-left:10px; margin-right: 10px; text-align:center;"><br />
hjkhkjhkjhjkhkjhjkhjhkkjh. ghjgjjhgjhgj.f rdyryeryery.ryreryer. fghgffjfgjfgjffgjgfjfg<br />
    </p><br />
    </div><br />
    <br/><br />
    </td><br />
    </tr><br />
</table><br />
<table width="500" height="40" bgcolor="#E6E776" align="center"><br />
<tr><br />
    <td><div align="center" ><br />
<span><br />
<a href="http://letsforum.com" target="_blank">Login</a> |<br />
<a href="http://letsforum.com/member.php?action=register" target="_blank">Join</a> |<br />
<a href="http://letsforum.com/misc.php?action=help" target="_blank">Help</a> |<br />
<a href="http://letsforum.com/misc.php?page=contact" target="_blank">Contact</a><br />
</span><br />
<br/><br />
 </div></td><br />
    </tr><br />
    </table><br />
</body><br />
</html>

<br /> everywhere
^ oh, I was mistaken. from where (which application) you pasted content into mass mail
Dreamweaver when I use preview it looks OK but when I receive it looks *ucked up LOL
Never used it before, but I'm saying where .m. is pointing at I think: dreamweaver fucks it up. Maybe it's a setting somewhere?
Anyone please how to fix that or at least where tell me there to find emails templates?
MyBB uses nl2br function to convert new lines to <br />. For example in inc/taks/massmail.php there is:
if(strpos($mass_email['htmlmessage'], '<br />') === false && strpos($mass_email['htmlmessage'], '<br>') === false)
          {
              $mass_email['htmlmessage'] = nl2br($mass_email['htmlmessage']);
          }
I don't really understand the purpose of this code but I guess if you add <br /> somewhere to your mass mail, the new lines aren't converted.
Pages: 1 2