Jump to content
Fórum Script Brasil
  • 0

Ajuda denovo ? '.'


lucas.rodrigues

Question

Usando o código abaixo, não consigo enviar um email.

Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in

Obrigado pela atençao, alguém saberia se tem como enviar sem colocar em algum servidor, queria testar localmente.

<?php

/*Conexao */

$db_local ="localhost:3306";
$db_login ="root";
$db_senha ="tomateverde";

$con = mysql_connect($db_local, $db_login, $db_senha);

mysql_select_db("database",$con);

if(!$con) {
        die ('Failed to connect to server: ' . mysql_error());
    }
$user = $_POST["name"];
$emaiil = $_POST["email"];

/*Select da senha do usuario*/
$query = mysql_query("select senha from usuarios where login =\"$user\"");
$senha = mysql_fetch_array($query);
$resultados = ($senha);
$msg = ($senha['senha']);
$assunto = ("CRM Forti");

/*Fim do select*/

/*select do email do usuario*/
$query2 = mysql_query("select email from usuarios where login =\"$user\"");
$email = mysql_fetch_array($query2);
$resultados2 = ($email);
$enviando = ($email['email']);
/*Fim do select*/

if(!$query) 
{ 
die ('Failed to connect to server: ' . mysql_error()); 
}

else
{ 
if (mysql_num_rows($query) > "0"){mail($enviando,$assunto,$msg);}
}

?>

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...