OK, I got a PHP/mySQL mailing list which works well. The thing is I would like to be able to say the users name in the content of the email, so I added name to Newsletter_members but now how do I get that into the body of the newsletter ($newslettertext) ?

I thought some find and replace but then it would need to be inside the email reteen.

Its quite a small script so I included it below

include "common.inc";
$con = mysql_connect($DB_SERVER, $DB_USER, $DB_PASS);

$rst = mysql_query("select Newsletter_Members.NewsletterID, Newsletter_Members.email, Newsletters.Name from Newsletter_Members LEFT JOIN Newsletters ON Newsletters.NewsletterID = Newsletter_Members.NewsletterID WHERE Newsletter_Members.NewsletterID = " . $newsletter, $con);

while ($row = mysql_fetch_row($rst)) {
if (!mail($row[1],$subject,$newslettertext,"From: \"" . $row[2] . "\" martin@1stconnection.net\n" )) {
echo "<FONT FACE=ARIAL SIZE=2 Color=Red>ERROR<FONT Color=Black> : Mail not sent to " . $row[1] . " at " . date("Y-m-d H:i:s") . "</FONT><BR>\n";
} else {
echo "<FONT FACE=ARIAL SIZE=2>Mail sent to " . $row[1] . " at " . date("Y-m-d H:i:s") . "</FONT><BR>\n";