I need to send a daily email based on data in mysql database which updates every day. I need it to be in html so that I can put links in there. I will also use images in the email. The basic structure will be:
Here's the list:
Business name (which is a link) Short description Image (which is a link)
Business name (which is a link) Short description Image (which is a link) . . .
All the data is in mySQL database (although the "image" in the database is a reference to a file eg /images/business/image.jpg)
My questions is should I be using phpmailer (I've never used it before) or using something like this:
//set up msg
$msg = "<html><body>Here's the list: <br /><br />";
while($i<numofelementsindb){
$business=mysql_result($result, $i,"business");
$description=mysql_result($result, $i,"description");
$msg .= "The business name is <a href='www.example.com'><b>{$business}</b></a> does {$description}<br />
";
$i++;
}
$msg .= "</body>
</html>";
//send
I also don't know how to imbed the image in the email either so any advice would be appreciated.
Do you have any safety suggestions as well?
Thanks