EDIT: Irgendwie funktioniert der Code nur auf dem Webserver und nicht auf localhost, also gibt es Ihren "Fix".PHPMailer funktioniert auf einer Seite, funktioniert aber nicht auf ähnliche Weise
So funktioniert mein PHP-Code, wie es dies mag sollte:
require 'PHPMailer/PHPMailerAutoload.php';
$nome = $_POST["nome"];
$subject = $_POST["subject"];
$message = $_POST["message"];
$email = $_POST["email"];
$contacto = $_POST["contacto"];
$body = "<p>Mail recebido de: </p>" . $nome . "<p>Email:</p>" . $email . "<p> Contacto:</p>" . $contacto . "<p>Mensagem:</p>" . $message ;
$mail = new PHPMailer();
$mail->CharSet = "text/html; charset=UTF-8;";
$mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only
$mail->CharSet = 'UTF-8';
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = "smtp.gmail.com";
$mail->Port = 587;
$mail->Username = "the email";
$mail->Password = the password;
$mail->SetFrom('the email', 'Organizer');
$mail->Subject = "[ORÇAMENTO] " . $subject;
$mail->Body = $body;
$mail->IsHTML(true);
$mail->AddAddress("the email");
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
$sucesso = 'Mensagem enviada com sucesso!';
}
das erste Skript sendet die E-Mail an sich selbst, aber auch das funktioniert nicht hier ($ mail-> Send() = 1 ich erhalte immer noch nicht die E-Mail):
require '../PHPMailer/PHPMailerAutoload.php';
$body = "<p>Car(a) " . ${'user' . $i} . ",</p> <p> Foi lhe associado(a) uma nova ocorrência. Consulte-a em http://www.organizer.com.pt . </p>";
$mail = new PHPMailer();
$mail->CharSet = "text/html; charset=UTF-8;";
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->CharSet = 'UTF-8';
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = "smtp.gmail.com";
$mail->Port = 587;
$mail->Username = "the email";
$mail->Password = the password;
$mail->SetFrom('the email', 'Organizer');
$mail->Subject = "Nova Ocorrência";
$mail->Body = $body;
$mail->IsHTML(true);
$mail->AddAddress($email);
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
$sucesso = 'Mensagem enviada com sucesso!';
}
ich alle Variablen getestet haben, die ich aus der Datenbank erhalten und so weiter und sie sind alle richtig, ich einfach nicht die E-Mail aus irgendeinem Grund erhalten . Jeder kann helfen?
S.S .: Tut mir leid, einige davon sind in Portugiesisch, ich denke, der Code ist immer noch vollkommen verständlich.
Eine Fehlermeldung? –
nein, angeblich wird die Mail gesendet, deshalb verstehe ich nicht. – Manuel
Check In Script 2 ... Ist es "require" ../PHPMailer/PHPMailerAutoload.php '; " ODER "erfordert" PHPMailer/PHPMailerAutoload.php '; " –