Jump to content
peste

PhpMailer autenticação

Recommended Posts

peste

Boa noite programadores.

Podiam me dar uma ajuda.

Eu ja consegui mandar mails com a aplicação phpmailer, mas so com autenticação, onde ponho o meu mail no username e password.

Mas queria enviar mail sem autenticação.

<?php
$body=$content;
include('class.phpmailer.php');//class phpmailer
$mail             = new PHPMailer();//nova mail
$mail->IsSMTP(); // informa a class que vai ser smtp
$mail->IsHTML(true);
$mail->SMTPDebug = 2;
$mail->SMTPAuth =true;             // Autenticao activada
$mail->SMTPDebug = true;
$mail->Mailer     ="smtp";             // tipo de mail
$mail->Host     = 'localhost'; // servidor smtp
$mail->Port     = 25;//465 ou 587 // port SMTP do gmail
$mail->From = "email@gmail.com"; //mail de quem manda
$mail->FromName = "FFLetter"; //nome de quem manda
$mail->AddAddress($e_mail, "teste");//quem recebe
    $mail->WordWrap = 50;
    $mail->Subject = $title;//titulo
    $track_image='<img src="http://localhost/newsletterteste/tracker.php?
    id_newsletter='.$ultimo_id.'&
    e_mail='.$e_mail.'" alt="" />';
    $mail->MsgHTML($body.$track_image);
?>

Agradecia ajuda.

Edited by brunoais
geshi

Ta demais o bar da praia maninho, sempre a PROGRAMAR em hard techo hehehehe

Share this post


Link to post
Share on other sites
peste

ja pus o $mail->username="kkcoisa"; e o $mail->password="kkcoisa";

ao mandar da-me este erro

SMTP -> ERROR: Failed to connect to server: Nenhuma ligação pode ser feita porque o computador de destino as recusou activamente. (10061).

Vou tentar descobrir, se puderem ajudar agradeço. Cumprimentos.

Edited by yoda

Ta demais o bar da praia maninho, sempre a PROGRAMAR em hard techo hehehehe

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.


×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.