# Attach images to email with php & sending etc

**URL:** <https://forum.kirupa.com/t/attach-images-to-email-with-php-sending-etc/240253>\
**Category:** Uncategorized\
**Created:** [October 1, 2007, 12:30pm UTC](https://forum.kirupa.com/t/attach-images-to-email-with-php-sending-etc/240253 "2007-10-01T12:30:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/patch/32/1095_2.png) [@Patch](https://forum.kirupa.com/u/Patch)\
**Post date:** [October 1, 2007, 12:30pm UTC](https://forum.kirupa.com/t/attach-images-to-email-with-php-sending-etc/240253/1 "2007-10-01T12:30:23Z")

</div>

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

<?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

<?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
