html - Sending mail with PHP throught XAMPP localhost (No email send) (begginner) -


i have code html form:

<form name="form1" method="post" action="c:/xampp/htdocs/shangri_la/contacto.php">        <p>          <label>nombre            <input name="nombre" type="text" id="nombre" size="35">          </label>        </p>        <p>          <label>correo responder            <input type="text" name="mail" id="mail">          </label>        </p>        <p>          <label>mensaje            <br>            <textarea name="textarea" cols="100" rows="15" id="textarea"></textarea>          </label>        </p>        <p>          <input type="submit" name="button" id="button" value="enviar">        </p>      </form>

and php:

< ?php   $nombre = $_post['nombre'];  $mail = $_post['mail'];    $header = 'from: ' . $mail . " \r\n";  $header .= "x-mailer: php/" . phpversion() . " \r\n";  $header .= "mime-version: 1.0 \r\n";  $header .= "content-type: text/plain";    $mensaje = "de " . $nombre . " \r\n";  $mensaje .= "responder a: " . $mail . " \r\n";  $mensaje .= "mensaje: " . $_post['mensaje'] . " \r\n";  $mensaje .= "enviado el " . date('d/m/y', time());    $para = 'my-email';  $asunto = 'mensaje de pagina principal';    mail($para, $asunto, utf8_decode($mensaje), $header);    echo 'mensaje enviado correctamente';    ?> 

the problem run code , sends me directly page php code same result received withouth xampp. change find sendmail function in xampp , php.ini. so, can me identify if there error in code, if error might in server settings or if there server option can use?

xampp php.ini:

[mail function]  ; win32 only.  ; http://php.net/smtp  smtp=smtp.gmail.com  ; http://php.net/smtp-port  smtp_port=465    ; win32 only.  ; http://php.net/sendmail-from  sendmail_from = my@mail.com  ; unix only.  may supply arguments (default: "sendmail -t -i").  ; http://php.net/sendmail-path  sendmail_path = “\”c:\xampp\sendmail\sendmail.exe\” -t”

xampp sendmail.ini:

[sendmail]    smtp_server=smtp.gmail.com  smtp_port=465  smtp_ssl=ssl  default_domain=localhost  error_logfile=error.log  debug_logfile=debug.log  auth_username=my@mail.com  auth_password=*******  force_sender=admin  hostname=localhost


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -