Ir para conteúdo
Fórum Script Brasil
  • 0

Envio de e-mails usando o sendmail


Flamaryon

Pergunta

Bom dia Pessoal!

Se alguém puder ajudar...

Valeu!!!

Código PHP:

<html>

<body>

<?php

if (isset($_POST['enviar'])) {

$nome = $_POST['seunome'];

$email = $_POST['email'];

$assunto = $_POST['assunto'];

$mensagem = $_POST['mensagem'];

$para = "meuemail@hotmail.com";

mail($para, $assunto, $mensagem, "From: $email\n");

}

?>

<br />

<form action="" method="post">

Nome:<br /><input type="text" name="nome" /><br />

E-mail:<br /><input type="text" name="email" /><br />

Assunto:<br /><input type="text" name="assunto" /><br />

Mensagem:<br /><textarea name="mensagem" rows="5"></textarea><br />

<input type="submit" name="enviar" value="Enviar e-mail" />

</form>

</body>

</html>

-------;

Código do PHP.ini

[mail function]

; For Win32 only.

;SMTP =

; For Win32 only.

;sendmail_from =

; 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

-------;

Código 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=meuemail@hotmail.com

; smtp port (normally 25)

smtp_port=25

; SMTPS (SSL) support

; auto = use SSL for port 465, otherwise try to use TLS

; ssl = alway use SSL

; tls = always use TLS

; none = never try to use SSL

smtp_ssl=auto

; 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=live.com

; log smtp errors to error.log (defaults to same directory as sendmail.exe)

; uncomment to enable logging

error_logfile=error.log

; create debug log as debug.log (defaults to same directory as sendmail.exe)

; uncomment to enable debugging

;debug_logfile=debug.log

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

auth_username=

auth_password=

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

; following three lines. do not enable unless it is required.

pop3_server=pop3.live.com

pop3_username=meuemail@hotmail.com

pop3_password=xxxxxxx

-------;

O erro apresentado: Warning: mail(): Failed to connect to mailserver at "127.0.0.1" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\EasyPHP-12.1\www\phpiniciante\aula3.php on line 10

-------;

Se alguém puder dar uma ajuda desde já agradeço.

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152k
    • Posts
      651,7k
×
×
  • Criar Novo...