Brock
09-16-2005, 05:14 PM
I'm making a simple script to pull names from a data base and send them a letter. Here's the code:
$sql = "SELECT id, firstname, firstdate, emailaddy FROM automailer where firstdate = '$now'";
$result=mysql_query($sql);
while($row = mysql_fetch_assoc($result)) {
$id = $row['id'];
$fname = $row['firstname'];
$email = $row['emailaddy'];
//first message (14 days)
$message = "<font face='verdana' size=2>Dear $fname,<br /><br />";
$message .= "<em>Where have you been?</em> <a href = \"http://www.cna-hgh.com\">www.cna-hgh.com</a> waiting for you as we have been now for over 7 years. We recognize that for many of you, price is an issue. Effective immediately, all Saizen (5 boxes) orders will receive a 10% discount and all Somatropin (5 boxes) orders will receive a 15% discount. That means that every individual that visits us at <a href = \"http://www.cna-hgh.com\">www.cna-hgh.com</a> or call us toll free at 1-888-254-7718 is eligible. These discounts do not apply to lab costs, physicals, and doctor consultations. <br /><br />";
$message .= "<em>What are you waiting for?</em> You want a fully licensed, FDA approved, 100% LEGAL doctor prescribed medical program! Get on board. Do not wait. Every caller will get complete care from every question to every answer. I personally guarantee it.<br /><br />";
$message .= "I hope to speak with you soon... <br /><br />";
$message .= "Gene Bolton President/CEO <br />";
$message .= "<a href=\"http://www.cna-hgh.com\">www.cna-hgh.com</a> <br />";
$message .= "email me at <a href=\"mailto:gene@cna-hgh.com\">gene@cna-hgh.com</a></font> <br />";
$message .= "<font face='verdana' size=2 color=red>toll free 1-888-254-7718</font>";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: \"noreply@cna-hgh.com\" <noreply@cna-hgh.com>" . "\r\n";
mail($email, 'Response 1', $message, $headers);
}
The problem is, the first person to recieve an email doesn't get the whole message! It cuts off right after the message says President/ceo. The message is fine for all the other people. I've been racking my brain on this for a while and can't come up with a solution.
Can someone please help me? Or at least point me in the right direction?
Brock
$sql = "SELECT id, firstname, firstdate, emailaddy FROM automailer where firstdate = '$now'";
$result=mysql_query($sql);
while($row = mysql_fetch_assoc($result)) {
$id = $row['id'];
$fname = $row['firstname'];
$email = $row['emailaddy'];
//first message (14 days)
$message = "<font face='verdana' size=2>Dear $fname,<br /><br />";
$message .= "<em>Where have you been?</em> <a href = \"http://www.cna-hgh.com\">www.cna-hgh.com</a> waiting for you as we have been now for over 7 years. We recognize that for many of you, price is an issue. Effective immediately, all Saizen (5 boxes) orders will receive a 10% discount and all Somatropin (5 boxes) orders will receive a 15% discount. That means that every individual that visits us at <a href = \"http://www.cna-hgh.com\">www.cna-hgh.com</a> or call us toll free at 1-888-254-7718 is eligible. These discounts do not apply to lab costs, physicals, and doctor consultations. <br /><br />";
$message .= "<em>What are you waiting for?</em> You want a fully licensed, FDA approved, 100% LEGAL doctor prescribed medical program! Get on board. Do not wait. Every caller will get complete care from every question to every answer. I personally guarantee it.<br /><br />";
$message .= "I hope to speak with you soon... <br /><br />";
$message .= "Gene Bolton President/CEO <br />";
$message .= "<a href=\"http://www.cna-hgh.com\">www.cna-hgh.com</a> <br />";
$message .= "email me at <a href=\"mailto:gene@cna-hgh.com\">gene@cna-hgh.com</a></font> <br />";
$message .= "<font face='verdana' size=2 color=red>toll free 1-888-254-7718</font>";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: \"noreply@cna-hgh.com\" <noreply@cna-hgh.com>" . "\r\n";
mail($email, 'Response 1', $message, $headers);
}
The problem is, the first person to recieve an email doesn't get the whole message! It cuts off right after the message says President/ceo. The message is fine for all the other people. I've been racking my brain on this for a while and can't come up with a solution.
Can someone please help me? Or at least point me in the right direction?
Brock