Jump to content

enviar mail


legd1991
 Share

Recommended Posts

boas pessoal...

ainda estou a trabalhar para a minha agenda e estou com um problema ao enviar uma mail

tenho este codigo:

<?php

require("includes/class.phpmailer.php");
include("includes/connection.php");
include("includes/funcoes1.php");
$email = $_POST['email'];
$assunto=$_POST['assunto'];
$msg=$_POST['Mensagem'];
$mail = new PHPMailer();

$mail->IsSMTP();
$mail->Mailer = 'smtp';
$mail->Host = 'smtp.gmail.com'; // SMTP server
$mail->Port = 25;
$mail->SMTPAuth = true;
$mail->Username = "username";
$mail->Password = "pss";
   
$mail->From       = "from";
$mail->FromName   = "Luís";
$mail->AddAddress("address");

$mail->AddReplyTo = "replyto";
$mail->WordWrap = 50;
$mail->IsHTML(false);
$mail->Subject    = "subject";
$mail->Body       = 'body';

if(!$mail->Send())
{
   echo "Error sending: " . $mail->ErrorInfo;
}
else
{
   echo "Letter is sent";
}




mysql_close($con);


?>

ao enviar da-me erro.. diz que nao é possivel autenticar..

gostava que m ajudassem...

cumps

legd1991

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • 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.