Foros del Web » Programando para Internet » PHP »

PHP OO Enviar e-mails

Estas en el tema de Enviar e-mails en el foro de PHP en Foros del Web. Buenas tardes a Tod@s!!! Antes que nada quiero contarles que es la primera vez que veo algo que tiene que ver con PHP. Lo que ...
  #1 (permalink)  
Antiguo 07/05/2014, 15:26
Avatar de Windrack  
Fecha de Ingreso: enero-2008
Ubicación: Buenos Aires
Mensajes: 217
Antigüedad: 16 años, 3 meses
Puntos: 4
Pregunta Enviar e-mails

Buenas tardes a Tod@s!!!
Antes que nada quiero contarles que es la primera vez que veo algo que tiene que ver con PHP.
Lo que quiero hacer es un formulario y que cuando hagan click en un boton... envien los datos del formulario a un email especifico.
Lo que hice hasta ahora es....
un INDEX.PHP con lo siguiente:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Formulario</title>
</head>

<body>
<form action="enviar_c.php" method="post">
<input type="text" name="asunto" /><br /><br />
<textarea name="mensaje"></textarea><br /><br />
<input type="submit" value="Enviar Solicitud" />
</form>
</body>
</html>

Luego tengo un archivo ENVIAR_C.PHP

<?php


if(isser($_POST['asunto']) && !empty($_POST['asunto']) &&
isset($_POST['mensaje']) && !empty($_POST['mensaje']))

{
$destino = "[email protected]";
$desde = "From:". "Makler WEB - MTK Solicitud";
$asunto = $_POST['asunto'];
$mensaje = $_POST['mensaje'];
mail($destino,$asunto,$mensaje,$desde);
echo "Hemos recibido tu Solicitud!";
}else{
echo "Tenemos problemas para recibir tu solicitud";
}


?>

Yo tengo un servidor propio con las web. Es un windows SERVER 2008 R2 con IIS
Segun lo que estuve leyendo... instale el programa SENDMAIL en el servidor... y modifique unas cosas en el PHP.INI y en el SENDMAIL.INI....


PHP.INI:

[mail function]
; For Win32 only.
;SMTP = 10.0.0.20

; For Win32 only.
;sendmail_from [email protected]

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "C:\SendMail\sendmail.exe -t"

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_paramaters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on NT, not valid in Windows 95).
;mail.log = syslog



y el SENDMAIL.INI


[sendmail]

; you must change mail.mydomain.com to your smtp server,
; or to IIS's "pickup" directory. (generally C:\Inetpub\mailroot\Pickup)
; emails delivered via IIS's pickup directory cause sendmail to
; run quicker, but you won't get error messages back to the calling
; application.

smtp_server=smtp.office365.com

; smtp port (normally 587)

smtp_port=587

; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify

default_domain=midominio.com

; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging
; error_logfile=sendmail_error.log

; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging
; debug_logfile=sendmail_debug.log

; if your smtp server requires authentication, modify the following two lines

;[email protected]
;auth_password=***********

; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines

pop3_server=outlook.office365.com
[email protected]
pop3_password=***********

; to force the sender to always be the following email address, uncomment and
; populate with a valid email address. this will only affect the "MAIL FROM"
; command, it won't modify the "From: " header of the message content

[email protected]

; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting. you can manually set the ehlo/helo name if required

hostname=




Que estoy haciendo mal??? Que me falta???


Mil gracias a TOD@S!!!!!

Etiquetas: email
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:37.