enviar email com php
Pessoal esse script que eu fiz ta dando erro de sintaxe quando chamo a função, ele nem roda, só mostra o error 500. Por favor eu preciso fazer isso funcionar.
<?php
session_start();
setlocale(LC_CTYPE,"pt_BR");
include 'PHPMailer/class.phpmailer.php';
include 'PHPMailer/class.smtp.php';
function sendMail($para,$de,$mensagem,$assunto)
{
//dados tmp
$smtp= "smtp.gmail.com";
$usuario="symphlower@gmail.com";
$senha = "xxxxxxxxxx";
$mail = new smtp;
$mail->Delivery('relay');
$mail->Relay($smtp,$usuario,$senha,465,'login',true);
$mail->TimeOut(10);
$mail->Priority('high');
$mail->From($de);
$mail->AddTo($para);
$mail->Html($mensagem);
if($mail->Send($assunto))
{
echo "alert('Deu certo')";
$_SESSION['feedback']="Mensagem enviada com sucesso";
header ("Location: feedback_index.html");
}
else
{
echo "alert('Deu errado')";
$_SESSION['feedback'] ="Mensagem não foi enviada";
header("Location: feedback_index.html");
}
}
$nome = $_POST['nome'];
$assunto = $_POST['assunto'];
$email = $_POST['email'];
$mensagem = $_POST['mensagem'];
$para ="symphlower@gmail";
$corpo =
'<html>
<head>
</head>
<body>
Nome:<br>'.$nome.'<p>
Email:<br>'.$email.'<p>
Assunto:<br>'.$assunto.'<p>
Menssagem:<br>'.$mensagem.'<p>
</body>
</html>';
sendMail($para,$email,$corpo,$assunto); //da erro aqui
?>
<?php
session_start();
setlocale(LC_CTYPE,"pt_BR");
include 'PHPMailer/class.phpmailer.php';
include 'PHPMailer/class.smtp.php';
function sendMail($para,$de,$mensagem,$assunto)
{
//dados tmp
$smtp= "smtp.gmail.com";
$usuario="symphlower@gmail.com";
$senha = "xxxxxxxxxx";
$mail = new smtp;
$mail->Delivery('relay');
$mail->Relay($smtp,$usuario,$senha,465,'login',true);
$mail->TimeOut(10);
$mail->Priority('high');
$mail->From($de);
$mail->AddTo($para);
$mail->Html($mensagem);
if($mail->Send($assunto))
{
echo "alert('Deu certo')";
$_SESSION['feedback']="Mensagem enviada com sucesso";
header ("Location: feedback_index.html");
}
else
{
echo "alert('Deu errado')";
$_SESSION['feedback'] ="Mensagem não foi enviada";
header("Location: feedback_index.html");
}
}
$nome = $_POST['nome'];
$assunto = $_POST['assunto'];
$email = $_POST['email'];
$mensagem = $_POST['mensagem'];
$para ="symphlower@gmail";
$corpo =
'<html>
<head>
</head>
<body>
Nome:<br>'.$nome.'<p>
Email:<br>'.$email.'<p>
Assunto:<br>'.$assunto.'<p>
Menssagem:<br>'.$mensagem.'<p>
</body>
</html>';
sendMail($para,$email,$corpo,$assunto); //da erro aqui
?>
Gmdkr
Curtidas 0
Respostas
Glauco
12/10/2017
Bom dia, blza?
Você não está usando de forma correta o phpmailer, veja o exemplo abaixo.
require_once('class.phpmailer.php');
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->SMTPDebug = 1;
$mailer->Port = 587; //Indica a porta de conexão para a saída de e-mails
$mailer->Host = 'smtplw.com.br';//Endereço do Host do SMTP Locaweb
$mailer->SMTPAuth = true; //define se haverá ou não autenticação no SMTP
$mailer->Username = 'smtplocaweb'; //Login de autenticação do SMTP
$mailer->Password = 'Gwb9etA323'; //Senha de autenticação do SMTP
$mailer->FromName = 'Bart S. Locaweb'; //Nome que será exibido para o destinatário
$mailer->From = 'remetente@email.com.br'; //Obrigatório ser a mesma caixa postal configurada no remetente do SMTP
$mailer->AddAddress('destinatario@email.com','Nome do destinatário'); //Destinatários
$mailer->Subject = 'Teste enviado através do PHP Mailer SMTPLW';
$mailer->Body = 'Este é um teste realizado com o PHP Mailer SMTPLW';
if(!$mailer->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mailer->ErrorInfo; exit; }
print "E-mail enviado!"
?>
Você não está usando de forma correta o phpmailer, veja o exemplo abaixo.
require_once('class.phpmailer.php');
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->SMTPDebug = 1;
$mailer->Port = 587; //Indica a porta de conexão para a saída de e-mails
$mailer->Host = 'smtplw.com.br';//Endereço do Host do SMTP Locaweb
$mailer->SMTPAuth = true; //define se haverá ou não autenticação no SMTP
$mailer->Username = 'smtplocaweb'; //Login de autenticação do SMTP
$mailer->Password = 'Gwb9etA323'; //Senha de autenticação do SMTP
$mailer->FromName = 'Bart S. Locaweb'; //Nome que será exibido para o destinatário
$mailer->From = 'remetente@email.com.br'; //Obrigatório ser a mesma caixa postal configurada no remetente do SMTP
$mailer->AddAddress('destinatario@email.com','Nome do destinatário'); //Destinatários
$mailer->Subject = 'Teste enviado através do PHP Mailer SMTPLW';
$mailer->Body = 'Este é um teste realizado com o PHP Mailer SMTPLW';
if(!$mailer->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mailer->ErrorInfo; exit; }
print "E-mail enviado!"
?>
GOSTEI 0
Gmdkr
12/10/2017
Mas com o phpMailer é o site que vai enviar o email e não a pessoa. Ai n vai ter sentido o feedback
GOSTEI 0
Jone
12/10/2017
Buy Driver's License, Passport, ((wottenkelly79@gmail.com)) ((whatsapp +237679499813)))id card,Birth Certificate and Other
Documents ((wottenkelly79@gmail.com))))
We offer driving license, ID cards, Passports, Visas, marriage certificates,
baptism cards, diplomas of all kinds for sale ,
Obtain Registered Ielts,Toefl & Gre Certificat((wottenkelly79@gmail.com))))
We produce high quality genuine passports, driving license, ID card .Database
registered and unregistered. All documents are registered in the respective
government databases. Also we offer the following card: social security numbers,
credit files and credit cards, school diplomas, grades all in a completely new name
issued and registered in the database system of government. . We use high
quality equipment and materials to produce genuine and false documents. All
secret features of these documents are carefully duplicated for our documents.
We are the only producer of quality fake and registered documents. We offer only
original high-quality registered and unregistered passports, drivers licenses,
identification cards, stamps, Visa, school Securities and other products for a
number of countries such as USA, Australia, Belgium, Brazil, Canada, Italy, Finland
France, Germany, Israel, Mexico, Netherlands, South Africa, Spain, UK and many
more countries
CONTACT
General Support: <<<<<<<<<<<<<((wottenkelly79@gmail.com))))
Contact <<<<<<<<<<<<<<<<, +237679499813
Skype >>>>>>>>>> fastdocuments1
UNIVERSAL PAPERS
WE ARE ABLE TO PRODUCE PASSPORTS, DRIVER'S LICENSE, ID CARD AND ALL OTHER DOCUMENTS FOR THE FOLLOWING COUNTRIES
SPAIN
ENGLAND
ITALY
RUSSIA
USA
CANADA
BRAZIL
FRANCE
NETHERLANDS
SWEDEN
NORWAY
BELGIUM
CROATIA
AUSTRIA
BULGARIA
DENMARK
FINLAND
GERMANY
GEORGIA
HUNGARY
ICELAND
IRELAND
LITHAUNIA
LATVIA
POLAND
PORTUGAL
ROMANIA
SWITZERLAND
AUSTRALIA
SOUTH AMERICA COUNTRIES
General Support: >>>>>>>>>> ((wottenkelly79@gmail.com))))
Support >>>>>>>>>>>>>>((wottenkelly79@gmail.com))))
Contact >>>>>>>>>> +237679499813
Skype >>>>>>>>>>fastdocuments1
Registered and unregistered passport . visas all, biometric passports, degrees,
driver's license, ID certificates cards.Training M GCSE, A-levels, high school
diploma Certificates, GMAT, MCAT and LSAT examination certificates,
marriage and death certificates, passports and new identity packages, replicated,
Real Degrees / Diplomas of most higher education institutions around the world
(with more than 4000 templates in the file) all designed to look 100% identical to
original. Custom printing (if we do not have the template file - just email us back
and we can make any alterations / modifications as
addresses) .SECOND, citizenship, identity, identification documents, diplomatic,
Our workers are former private investigators, consulates, senior government staff
and experienced experts with experience, we have strong connections with
higher personnel in all areas of property registration documents and passports in
exchange for these countries They are linked to the passport agency in each of
these countries and with the help of his connections to all our customers who
require a document or passport countries are 100% safe and guaranteed receipt
of very high quality genuine estate documents recorded that can not be identified
as false !! Not even a custom official experience or machine never dictate false
document since the document is no different than real government issued! All our
documents Registered real genuine citizenship data bases have their personal
data recorded in the database system and 100% readable machine. Feel free to
get detailed information about our services.
Documents ((wottenkelly79@gmail.com))))
We offer driving license, ID cards, Passports, Visas, marriage certificates,
baptism cards, diplomas of all kinds for sale ,
Obtain Registered Ielts,Toefl & Gre Certificat((wottenkelly79@gmail.com))))
We produce high quality genuine passports, driving license, ID card .Database
registered and unregistered. All documents are registered in the respective
government databases. Also we offer the following card: social security numbers,
credit files and credit cards, school diplomas, grades all in a completely new name
issued and registered in the database system of government. . We use high
quality equipment and materials to produce genuine and false documents. All
secret features of these documents are carefully duplicated for our documents.
We are the only producer of quality fake and registered documents. We offer only
original high-quality registered and unregistered passports, drivers licenses,
identification cards, stamps, Visa, school Securities and other products for a
number of countries such as USA, Australia, Belgium, Brazil, Canada, Italy, Finland
France, Germany, Israel, Mexico, Netherlands, South Africa, Spain, UK and many
more countries
CONTACT
General Support: <<<<<<<<<<<<<((wottenkelly79@gmail.com))))
Contact <<<<<<<<<<<<<<<<, +237679499813
Skype >>>>>>>>>> fastdocuments1
UNIVERSAL PAPERS
WE ARE ABLE TO PRODUCE PASSPORTS, DRIVER'S LICENSE, ID CARD AND ALL OTHER DOCUMENTS FOR THE FOLLOWING COUNTRIES
SPAIN
ENGLAND
ITALY
RUSSIA
USA
CANADA
BRAZIL
FRANCE
NETHERLANDS
SWEDEN
NORWAY
BELGIUM
CROATIA
AUSTRIA
BULGARIA
DENMARK
FINLAND
GERMANY
GEORGIA
HUNGARY
ICELAND
IRELAND
LITHAUNIA
LATVIA
POLAND
PORTUGAL
ROMANIA
SWITZERLAND
AUSTRALIA
SOUTH AMERICA COUNTRIES
General Support: >>>>>>>>>> ((wottenkelly79@gmail.com))))
Support >>>>>>>>>>>>>>((wottenkelly79@gmail.com))))
Contact >>>>>>>>>> +237679499813
Skype >>>>>>>>>>fastdocuments1
Registered and unregistered passport . visas all, biometric passports, degrees,
driver's license, ID certificates cards.Training M GCSE, A-levels, high school
diploma Certificates, GMAT, MCAT and LSAT examination certificates,
marriage and death certificates, passports and new identity packages, replicated,
Real Degrees / Diplomas of most higher education institutions around the world
(with more than 4000 templates in the file) all designed to look 100% identical to
original. Custom printing (if we do not have the template file - just email us back
and we can make any alterations / modifications as
addresses) .SECOND, citizenship, identity, identification documents, diplomatic,
Our workers are former private investigators, consulates, senior government staff
and experienced experts with experience, we have strong connections with
higher personnel in all areas of property registration documents and passports in
exchange for these countries They are linked to the passport agency in each of
these countries and with the help of his connections to all our customers who
require a document or passport countries are 100% safe and guaranteed receipt
of very high quality genuine estate documents recorded that can not be identified
as false !! Not even a custom official experience or machine never dictate false
document since the document is no different than real government issued! All our
documents Registered real genuine citizenship data bases have their personal
data recorded in the database system and 100% readable machine. Feel free to
get detailed information about our services.
GOSTEI 0