# Send email php to many people

**URL:** <https://forum.kirupa.com/t/send-email-php-to-many-people/237563>\
**Category:** Uncategorized\
**Created:** [August 31, 2007, 1:55pm UTC](https://forum.kirupa.com/t/send-email-php-to-many-people/237563 "2007-08-31T13:55:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![max23](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@max23](https://forum.kirupa.com/u/max23)\
**Post date:** [August 31, 2007, 1:55pm UTC](https://forum.kirupa.com/t/send-email-php-to-many-people/237563/1 "2007-08-31T13:55:50Z")

</div>

As I can send he himself email to several people. Please … thanksss

```php

<?
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");

if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);

if(isset($_POST['Submit'])){
    $to = "miemail@hotmail.com";    
    $to2 = $_POST['email'];                
    $from2 = "miemail@hotmail.com";    
    $subject2 = "Confirmación";
    $body2 = "Gracias";
    $subject = "Contacto: " . $_POST['nome'];
    $body = " Nombre: " . $_POST['nome'] . "
";
    $body .= " E-mail: $to2". "
";
    $body .= " Teléfono: " . $_POST['telefono'] . "
";
    $body .= " Población: " . $_POST['poblacion'] . "
";
    $body .= " ". "
";
    $body .= " Mensaje: " ."
";
    $body .= " --------------------------------------". "
";
    $body .= " " . $_POST['message_txt'] . "

";
    

    if (@mail($to, $subject,$extraInfo . $body, "From: $email
X-Mailer: PHP/" . phpversion())){
        if($_POST['desideri'] == "true"){
            mail($to2, $subject2,$extraInfo . $body2, "Return-Path: <miemail@hotmail.com>
" . "From: $from2
" . "Reply-to: miemail@hotmail.com
" . "X-Mailer: PHP/" . phpversion());
        }
        
        echo "Atención=" . urlencode("Email ha sido enviado");
    } else {
        
        echo "Atención=" . urlencode("Se han producido errores");
    }
}
?>

```
