php booking form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yanecek
Forum Newbie
Posts: 1
Joined: Fri Jan 08, 2010 4:12 am

php booking form

Post by yanecek »

Hello,

> > Hi there, I'm having problem with php code. From WF documentation I know that I have to write in the code smtp details, which I did. But now my code dosen't seems to be working.
> > I'm newbe to PHP and I'm sure there is some silly mistake in my code
> > Anybody can help me
> >
> > here is my php code

> >

Code: Select all

> > 
> > <?php
> > if (isset($_POST['email'])) {
> > 
> > $msg= "";
> > $msg= "Message hostalnuevasnaciones.es contact form";
> > $msg.= "\nVersión: ". strip_tags($_POST['version']);
> > $msg.= "\nNombre: ". strip_tags($_POST['nombre']);
> > $msg.= "\nEmail: ".strip_tags($_POST['email']);
> > $msg.= "\nTelefono: ".strip_tags($_POST['tfno']);
> > 
> > $msg.= "\nNº personas: ". strip_tags($_POST['noper']);
> > $msg.= "\nNº habitaciones: ".strip_tags($_POST['nohab']);
> > $msg.= "\nTipo de habitación: ".strip_tags($_POST['tipohab']);
> > 
> > $msg.= "\nFecha de entrada: ".strip_tags($_POST['dia-de-llegada'])."- ".strip_tags($_POST['mes-de-llegada'])."- ".strip_tags($_POST['ano-de-llegada']);
> > $msg.= "\nFecha de salida: ".strip_tags($_POST['dia-de-salida'])."- ".strip_tags($_POST['mes-de-salida'])."- ".strip_tags($_POST['ano-de-salida']);
> > 
> > $msg.= "\nComentarios: \n".strip_tags($_POST['comentarios']);
> > 
> > $subject = "Consulta enviada desde hostalnuevasnaciones.es por: ".$_POST['nombre'];
> > 
> > mail('tomek.grzebielucha@gmail.com', $subject, $msg, "FROM:". strip_tags($_POST['nombre'])."<".strip_tags($_POST['email']).">\n");
> > 
> > 
> > 
> > 
> > 
> > $smtp "smtp", array ('host' => "smtp.gmail.com",
> > 'auth' => true,
> > 'username' => "tomek.grzebielucha@gmail.com",
> > 'password' => "xxxxxxx"));
> > 
> > $mail = $smtp->send($to, $headers, $body);
> > ?>
> > 
> >
dejvos
Forum Contributor
Posts: 122
Joined: Tue Mar 10, 2009 8:40 am

Re: php booking form

Post by dejvos »

¡Hola!

The php function mail() which you use is not suitable for sending emails. I use to work with PHPMailer - some tutorial is here: http://www.askapache.com/php/phpfreaks- ... orial.html

This class works fine, I have never had a problem with this class.

Good luck!
Post Reply