1
I would like to know a method to send a form
who doesn’t have the field email
. It will have only three fields: Nome
, Telefone
and Cidade
.
However, when sending arrives like this
The code I have:
<?php
require_once('PHPMailer-master/PHPMailerAutoload.php');
PHP_OS == "Linux" ? $quebra_linha = "\n" : $quebra_linha = "\r\n";
$nome = trim($_POST["nome"]);
$tel = $_POST["telefone"];
$cid = $_POST["cidade"];
switch ($cid) {
case "ipatinga":
$destino = "[email protected]";
break;
case "fabriciano":
$destino = "[email protected]";
break;
case "timoteo":
$destino = "[email protected]";
break;
}
$email = "<br><b>NOME:</b> ".$nome."<br><b>TELEFONE:</b> ".$tel." <br> <b>CIDADE:</b> ".$cid."</body></html>";
$mail = new PHPMailer();
$mail->IsMail();
$mail->SetFrom($eml, $nom);
$mail->Subject = "Agendamento de visita";
$mail->MsgHTML($email);
$mail->AddAddress($destino, utf8_decode('Unimed'));
if (!$mail->send())
$msgerro = "Não foi possível enviar sua mensagem de contato. Tente novamente dentro de alguns instantes.";
else
$msgerro = "Sua mensagem de contato foi enviada com sucesso!";
?>
How to make that instead of Root User
and [email protected]
have personalized data?
Great Wendell. Is this authentication for email base only or for each city correspondent? There will be three different emails, one for each city.
– Marcelo Victor
@Marcelovictor this authentication is for the email that will be used to send the email to the correspondents, regardless of the amount of correspondents you need only one authentication.
– Wendell
Got it. Thanks a lot for the help @Wendell
– Marcelo Victor