I can’t send more than one e-mail

Asked

Viewed 27 times

0

I have the following code for sending email, but only in the first email receives the second no.

$to  = "[email protected]";
$to  .= "[email protected]";

$subject = 'Guarapari Virtual - Corretores On-Line';

$message = "
Prezado cliente!<p>
<b>{$enviar_gc_nome}</b> visitou o Guarapari Virtual e enviou uma solicitação de orçamento para você pelo canal Corretores On-Line.<p>
";
$message .= '<b>E-Mail: </b>'.$enviar_gc_email.'<p>';
$message .= '<b>Telefone: </b>'.$enviar_gc_telefone.'<p>';
$message .= '<b>Data da entrada: </b>'.$enviar_gc_dataentrada.'<p>';
$message .= '<b>Data da saída: </b>'.$enviar_gc_datasaida.'<p>';
$message .= '<b>Número de adultos: </b>'.$enviar_gc_nadultos.'<p>';
$message .= '<b>Número de crianças: </b>'.$enviar_gc_ncriancas.'<p>';
$message .= '<b>Mensagem: </b>'.$enviar_gc_msg.'<p>';
$message .= '<p>';
$message .= 'Obrigado!';

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers .= "From: {$enviar_gc_nome} <{$enviar_gc_email}>" . "\r\n";

mail($to, $subject, $message, $headers);
  • 2

    try separating emails with a comma (http://php.net/manualen/function.mail.php)

  • @thiagoalessio I did, but I keep getting only in the first email

  • comma separation as @thiagoalessio mentioned works perfectly for me. You can also add the second email to CC in the header, like this: $headers .= "\n Cc: [email protected]";

  • @Ricardopunctual Unfortunately for me it’s not working

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.