Attach images to email with php & sending etc

Hi guys,

I’m creating a form that generates a HTML email, however I need to have 4 images in the structure etc. How can attach them with php i.e. choose my 4 images then when I click send they go with the email.

Also while I am here, I have a system where I write people 's emails to the database i.e. I have between 20-30 and I want to be able to send an email to them all with one form

i.e.


<?php

$to = $row_emails['email'];

//etc....

mail($to, $subject, $body, $headers);

?>

(the above $to bit needs a loop I think to cal them all, not sure at the moment)

Because at the moment the only way I have been able to do it is something like this:


<?php

$to = email1@example.com;
$to .= email2@example.com;


//etc....

mail($to, $subject, $body, $headers);

?>

But this means the user has to type them in…which i don’t want to do.

Any advice or information on the subject would be great.

Thanks