It works great except every 5 or so emails a stray character is
injected into my email
I have no idea where this character is coming from but I will show a fragment of my code:!
Code: Select all
$myBody .=" <a href='http://www.1purpose-bethel.org'>Home</a><br/>";
$myBody .=" <a href='http://www.bethel.org/'>Bethel</a><br/>";
$myBody .=" <a href='http://www.singles.ag.org/'>AG-Singles</a><br/>";
$myBody .=" <a href='http://www.bethel.org/Sermons.htm'>Sermons</a><br/>";on the third line and the very last character.
Code: Select all
<p><span style=A:link {color:#FFFFFF; text-decoration: none; font-size: 9px; line-height: 1.2em; font-family:Verdana, Arial;}'><br/><br/> <a href='http://www.1purpose-bethel.org'>Home</a><br/>&nbs!
p;
<a href='http://www.bethel.org/'>Bethel</a><br/> <aDid you use special formating? The reason I ask is I find lots of code in my personal HTML emails that I receive from verious groups and organizations that I belong to. I am wondering if I am supposed to include these types of characters in my emails?
Your insight would be appreciated
Thank You
Kevin
NOTE: As it stands I can send email I just have a a few stray chars in my navigation, but if this stray char pops up in the html table formating it could skew the entire message.
This is way over the top but if you were interested in what my html email looks like in its entirety:
Code: Select all
<?php require_once('sessionMan_cookiesCheck_DBconn.php'); ?>
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->From = "admin@mysite.org";
$mail->FromName = "user";
$mail->Host = "relay-hosting.securesever.net"; // SMTP servers
$mail->Port = 3535;
//$mail->Mailer = "smtp";
$query = ('SELECT fName, email, accessLevel FROM user where accessLevel="user"')or die(mysql_error());
$result = MYSQL_QUERY($query);
while ($row = mysql_fetch_array ($result))
{
// HTML body
$myBody ="<html>";
$myBody .="<head>";
$myBody .="</head>";
$myBody .="<body bgcolor='#FFFFFF' LINK='#FFFFFF' VLINK='#FFFFFF' ALINK='#FFFFFF'>";
$myBody .="<table width='620' border='0' align='center' cellpadding='0' cellspacing='0' bgcolor='#092F5E'>";
$myBody .="<tr>";
$myBody .="<td height='115' colspan='3' valign='top'>";
$myBody .="<img alt='banner' src='cid:my-attach1'/>"; //banner.jpeg--banner image here
$myBody .="</td>";
$myBody .="</tr>";
$myBody .="<tr>";
$myBody .="<td valign='top' width='18%' height='150'>";
$myBody .="<p> </p>";
$myBody .="<div align='center' style='color:#FFFFFF; font-family:Verdana; line-height: 1.3em; font-size: 11px;'>";
$myBody .="<p>WEDNESDAYS<br />";
$myBody .="Keys Chapel<br />";
$myBody .="<strong>7:15PM<//strong><br />";
$myBody .="<em>(before service)</em> <br />";
$myBody .="The Connection<br />";
$myBody .="6:45PM<br />";
$myBody .="In Room 123 <br />";
$myBody .="Next Door";
$myBody .="</p>";
$myBody .="<p>SUNDAYS<br />";
$myBody .=""On Course"<br />";
$myBody .="Crystal Room<br />";
$myBody .="<strong>9:15AM</strong></p>";
$myBody .="<p><a href='http://www.bethel.org/WNLBulletin.pdf'>Events<br />";
$myBody .="Bulletin<br /></a>";
$myBody .="</p>";
$myBody .="<p>PASTOR<br />";
$myBody .="Art Gorman</p>";
$myBody .="<p>PHONE<br />";
$myBody .="(408) 246-6790<br />";
$myBody .="x247</p><br/><br/><br/><br/><br/><br/>";
$myBody .="</div>";
$myBody .="</td>";
$myBody .="<td width='62%' valign='top' bgcolor='#FFFFFF'>";
$myBody .="<table width='100%' align='center' cellpadding='20'>";
$myBody .="<tr>";
$myBody .="<td width='81%' align='left' valign='top'>";
$myBody .="<p> </p>Make my joy complete by being of the same mind, maintaining the same love, united in spirit, intent on one purpose.";
$myBody .="<div align='right'><strong>Philippians 2:2</strong></div> </td>";
$myBody .="<td width='19%' align='left' valign='top'>";
$myBody .="<img alt='PA and Wife' src='cid:my-attach'/> "; //PaAndWife.jpeg--image of pastor art and kay
$myBody .="</td>";
$myBody .="</tr>";
$myBody .="<tr>";
$myBody .="<td colspan='2' align='left' valign='top'>";
$myName = $row['fName'];
$myName = trim("$myName", "'");
$myBody .="<p><strong>Hi: $myName </strong></p>";// insert user name here
$myBody .="<p>".$_POST['elm1']."</p>";
$myBody .="</td>";
$myBody .="</tr>";
$myBody .="<tr>";
$myBody .="<td colspan='2' align='left' valign='top'>";
$myBody .="If you wish to be removed from 1Purpose mailing list please";
$myBody .="<a href='mailto:1padmin@1purpose-bethel.org' style='color:blue;'> click here</a>! Place remove me in the subject list. Then place your name and email address in the body of the document<br/><div align='right'>Thank You!</div>";
$myBody .="</td>";
$myBody .="</tr>";
$myBody .="</table>";
$myBody .="</td>";
$myBody .="<td valign='top' width='20%'>";
$myBody .="<p><span style=A:link {color:#FFFFFF; text-decoration: none; font-size: 9px; line-height: 1.2em; font-family:Verdana, Arial;}'><br/><br/>";
$myBody .=" <a href='http://www.1purpose-bethel.org'>Home</a><br/>";
$myBody .=" <a href='http://www.bethel.org/'>Bethel</a><br/>";
$myBody .=" <a href='http://www.singles.ag.org/'>AG-Singles</a><br/>";
$myBody .=" <a href='http://www.bethel.org/Sermons.htm'>Sermons</a><br/>";
$myBody .=" <a href='http://www.1purpose-bethel.org/newsBriefs.php'>News</a><br/>";
$myBody .=" <a href='http://www.1purpose-bethel.org/personalGrowth.html'>Growth</a> <br/>";
$myBody .=" <a href='http://www.1purpose-bethel.org/ministries.html'>Ministries</a><br/>";
$myBody .=" <a href='http://bible.oneplace.com/'>Bible Tools</a><br/>";
$myBody .=" <a href='http://www.1purpose-bethel.org/sportsFitness.php'>Fitness-Sports</a>";
$myBody .="<br/>";
$myBody .=" <a href='http://www.1purpose-bethel.org/images/phpSlideshow/phpslideshow.php'>Slideshows</a><br />";
$myBody .="</span></p>";
$myBody .="</td>";
$myBody .="</tr>";
$myBody .="</table>";
$myBody .="</body>";
$myBody .="</html>";
// Plain text body (for mail clients that cannot read HTML)
$text_body = $_POST['plainTextBody'];
$mail->Body = $myBody;
$mail->AltBody = $text_body;
$mail->AddAddress(trim($row["email"], "'"), trim($row["fName"], "'"));
$mail->AddEmbeddedImage("banner.jpg", "my-attach1", "banner.jpg");
$mail->AddEmbeddedImage("PaAndWife.jpeg", "my-attach", "PaAndWife.jpeg");
//$mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
if(!$mail->Send())
echo "There has been a mail error sending to " . $row["email"] . "<br>";
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
}
?>
<script type="text/javascript">
alert("Your messages have been sent!\n\nMay the lord continue to bless this ministry!\n\n");
window.location = "../connect.php";
</script>
<?php
echo "<h4>The mail has been sent! May the lord continue to bless this ministry!</h4>";
?>