Skip to main content
Participant
February 10, 2010
Answered

How to format a confirmation e-mail in DWCS3?

  • February 10, 2010
  • 1 reply
  • 482 views

Hello,

I'm building a site in which the user has to enter personal information, upload that information into a MySQL DB, and at the end send a conformation e-mail to the user.

So far things are working properly, but I'm still unable to make the system to send the confirmation e-mail in HTML format. My code is as follows:

<?php

$id = $row_rsMision2010['ID'];

$Nombre = $row_rsMision2010['Nombre'];

$Apellido = $row_rsMision2010['Apellido1'];

$Agencia = $row_rsMision2010['Agencia'];

$Direccion = $row_rsMision2010['Direccion'];

$Colonia = $row_rsMision2010['Colonia'];

$Ciudad = $row_rsMision2010['Ciudad'];

$Estado = $row_rsMision2010['Estado'];

$CP = $row_rsMision2010['CP'];

$Lada = $row_rsMision2010['Lada'];

$Telefono = $row_rsMision2010['Telefono'];

$Puesto = $row_rsMision2010['Puesto'];

$Reserva = $row_rsMision2010['Reserva'];

$to = $row_rsMision2010['Mail'];

$subject = "Codigo de Reservacion Registro La Mision 2010 Las Vegas Evolution";

$headers = "De: Oficina de Turismo de Las Vegas para Mexico y Centroamerica" .

"MIME-Version: 1.0rn" .

"Content-type: text/html; charset=UTF-8";

$body = "<html><body>" .

"<h2>Su registro ha sido exitosamente recibido en nuestro sistema.<h2/>" .

"<p>Sus datos registrados son los siguientes:</p>" .

"<p>Nombre: '$Nombre'</p>" .

"<p>Apellidos: '$Apellido'</p>" .

"<p>Agencia: '$Agencia'</p>" .

"<p>Dirección: '$Dirección'</p>" .

"<p>Colonia: '$Colonia'</p>" .

"<p>Ciudad: '$Ciudad'</p>" .

"<p>Estado: '$Estado'</p>" .

"<p>C.P.: '$CP'</p>" .

"<p>Teléfono: '$Lada' - '$Telefono'</p>" .

"<p>Puesto: '$Puesto'</p>" .

"<p>Su Código único e intransferible de admisión es: '$Reserva'</p>" .

"<p>¡No olvide imprimirlo y mostrarlo junto con su identificación oficial a su llegada al evento!</p>" .

"</body></html>";

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

?>

As far as I understand, I might be mistyping something, or having a syntax error while defining the $body variable.

Could someone help me out and check what am I doing wrong?

Thanks for your support in advance.

This topic has been closed for replies.
Correct answer David_Powers

Each header needs to be on a separate line. You have simply concatenated them together as a single string.

$headers = "De: Oficina de Turismo de Las Vegas para Mexico y Centroamerica" .

"MIME-Version: 1.0rn" .

"Content-type: text/html; charset=UTF-8";

This should be:

$headers = "From: Oficina de Turismo de Las Vegas para Mexico y Centroamerica\r\n" .

"MIME-Version: 1.0\r\n" .

"Content-type: text/html; charset=UTF-8";

1 reply

David_Powers
David_PowersCorrect answer
Inspiring
February 11, 2010

Each header needs to be on a separate line. You have simply concatenated them together as a single string.

$headers = "De: Oficina de Turismo de Las Vegas para Mexico y Centroamerica" .

"MIME-Version: 1.0rn" .

"Content-type: text/html; charset=UTF-8";

This should be:

$headers = "From: Oficina de Turismo de Las Vegas para Mexico y Centroamerica\r\n" .

"MIME-Version: 1.0\r\n" .

"Content-type: text/html; charset=UTF-8";

Participant
February 12, 2010

Thank you so much!

Sure it worked!