-1
By experiencing the phpmailer
, only thing it does is show the screen of Browser
blank.
Has anyone ever done that?
Could I have been blocked on the mail server?
<?php
require_once('PHPMailer/class.phpmailer.php');
$local_serve = "127.0.0.1"; // local do servidor
$usuario_serve = "root"; // nome do usuario
$senha_serve = ""; // senha
$banco_de_dados = "GCD"; // nome do banco de dados
$conn = @mysql_connect($local_serve,$usuario_serve,$senha_serve,$banco_de_dados) or die ("O servidor não responde!");
// conecta-se ao banco de dados
$db = @mysql_select_db($banco_de_dados,$conn)
or die ("Não foi possivel ligar-se a Base de Dados!");
$sql = ("SELECT Nome, campos FROM tabelas WHERE campos < (now()+ interval 10 day)");
$validade = mysql_query($sql);
while($row = mysql_fetch_array($validade)){
$Nome = $row[0];
$data = $row[1];
$PHPMailer = new PHPMailer();
$PHPMailer->isHTML( true );
// codificação UTF-8, a codificação mais usada recentemente
$PHPMailer->Charset = 'UTF-8';
// Configurações do SMTP
$PHPMailer->SMTPAuth = True;
$PHPMailer->SMTPSecure = 'none';
$PHPMailer->Host = '--------';
$PHPMailer->Port = '25';
$PHPMailer->Username = '--------';
$PHPMailer->Password = '----------';
// E-Mail do remetente (deve ser o mesmo de quem fez a autenticação
// nesse caso [email protected])
$PHPMailer->From = '----------------';
// Nome do rementente
$PHPMailer->FromName = '--------';
// assunto da mensagem
$PHPMailer->Subject = 'Documento';
// corpo da mensagem
$PHPMailer->Body = "<body><p><strong>Faltam 10 dias para terminar</strong> $Nome</body>";
// corpo da mensagem em modo texto
$PHPMailer->AltBody = 'Mensagem em texto';
// adiciona destinatário (pode ser chamado inúmeras vezes)
$PHPMailer->AddAddress( 'MAILLL' );
// adiciona um anexo
$PHPMailer->AddAttachment( '' );
// verifica se enviou corretamente
if ( $PHPMailer->Send() )
{
echo "Enviado com sucesso";
}
else
{
echo 'Erro do PHPMailer: ' . $PHPMailer->ErrorInfo;
}
}
?>
So they can help you, put example of the source, how you did the integration and the error that is happening.
– lionbtt
PHP/apache logs also
– fotanus
Place at the beginning of the script this code
ini_set('display_errors', true); error_reporting(E_ALL);
will display errors. Then edit your question and place errors.– rray
I recommend posting your code so we can analyze it...
– Luiz Picolo
I put this code and you still don’t show me anything.
– ChrisAdler
@user3253195 Did you receive the email you are using to test phpmailer? Additionally, you can output when everything goes well, such as:
if ($PHPMailer->Send()) { echo 'email enviado com sucesso!; } else { echo 'Falha ao enviar!'; }'
and so you know whether it’s sending or not.– Zuul
Yes at the end I have this. But I don’t get anything or show anything. if ( $Phpmailer->Send() ) { echo "Successfully shipped"; } Else { echo 'Phpmailer error: ' . $Phpmailer->Errorinfo; } }
– ChrisAdler
@user3253195 So the execution of your code is probably stopping for a reason other than Phpmailer, please enter all the code, at least since opening the php tag
<?php
how far you actually have theif ( $PHPMailer->Send() ) {
... Hide clear email, password and other potentially compromising information by substituting****
.– Zuul
complete code posted
– ChrisAdler
No you do not put anything... look at this example http://stackoverflow.com/questions/12001110/php-mailer-cannot-send-email-to-anyone-except-myself
– Silvio Andorinha
I put but removed to copy the code here
– ChrisAdler