MyBB Community Forums
HTML emails BUG - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: HTML emails BUG (/thread-146023.html)

Pages: 1 2


HTML emails BUG - marcus123 - 2013-09-28

Guys I have a problem MyBB adds <br /> tag to the end of each code line.
How to fix that?


RE: HTML emails BUG - .m. - 2013-09-28

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



RE: HTML emails BUG - marcus123 - 2013-09-28

What do you mean where is that code?


RE: HTML emails BUG - .m. - 2013-09-28

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


RE: HTML emails BUG - marcus123 - 2013-09-28

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


RE: HTML emails BUG - .m. - 2013-09-28

^ oh, I was mistaken. from where (which application) you pasted content into mass mail


RE: HTML emails BUG - marcus123 - 2013-09-28

Dreamweaver when I use preview it looks OK but when I receive it looks *ucked up LOL


RE: HTML emails BUG - Tankey - 2013-09-28

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?


RE: HTML emails BUG - marcus123 - 2013-09-29

Anyone please how to fix that or at least where tell me there to find emails templates?


RE: HTML emails BUG - Destroy666 - 2013-09-29

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.