• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

phpmailer inkludieren

syuam

Neues Mitglied
und zwar bin auf der Suche nach einem hilfreichen Tutorial zum phpMailer auf diese Seite gestoßen: PHP-Mailer: Kontaktformular spinnt. Hilfe! - PSD-Tutorials.de
Mir ging es hauptsächlich darum, den phpMailer in ein bestehendes Formular zu binden, allerdings weiß ich nicht worauf diese Zeile hinausläuft:
PHP:
require_once ($_SERVER['DOCUMENT_ROOT'] . "/included/config.php");
sollte es nicht so sein? :
PHP:
require("phpmailer/class.phpmailer.php");
Wüsste jemand worum es da geht? danke für hilfe
 
Wüsste jemand worum es da geht?
Jau, ich. Und damit wäre deine Frage beantwortet.

Wenn du mal etwas weiter runtergescrollt hättest, hättest du diese Zeile gefunden:
PHP:
require_once(ROOT_PATH . "included/class.phpmailer.php");
Und wieder mal zeigst du zu wenig Eigeninitiative.
 
sorry falsch ausgedrückt...ich meine konkret die Datei config.php, die finde ich in meinem phpMailer-download gar nicht..muss die erst erstellt werden?
 
Nein musst du nicht. Ich denke die Config gehört einfach zu dem System welches der andere erstellt hat. Sprich die Config hat überhaupt nichts mit dem phpmailer zu tun.
 
Hallo,

also ich habe auch so eine.
der grund ist wenn sich mal was ändert an den zugangsdaten muss man nich 100te sachen ändern sondern nur an eine stelle oder man phpmailer mal updatet bleiben die einstellungen erhalten und bei mir wenn ich local test brauch ich ja kein smtp aber wenn es online ist schon.
PHP:
<?php


    $mail = new PHPMailer(true); //New instance, with exceptions enabled

         $mail->SetLanguage("de", "language/");

if($_SERVER['SERVER_NAME'] != "localhost"){ // lokal test E-Mail [email protected]
    $mail->IsSMTP(); // telling the class to use SMTP
    $mail->IsSendmail();  // tell the class to use Sendmail
    $mail->Host          = "pop.provider.de"; // sets the SMTP server
    $mail->SMTPAuth      = true;    // enable SMTP authentication
    $mail->SMTPKeepAlive = true;  // SMTP connection will not close after each email sent
    $mail->Port          = 25;        // set the SMTP port for the GMAIL server
    $mail->Username      = "BENUTZERNAME"; // SMTP account username 
    $mail->Password      = "PW";        // SMTP account password
}
?>

Cheffchen
 
Wobei das
PHP:
$mail->SMTPKeepAlive = true;
nur bei Massenmails Sinn macht.
 
Aus der Doku:
[TABLE="class: common"]
[TR]
[TD]$SMTPKeepAlive[/TD]
[TD][/TD]
[TD]Prevents the SMTP connection from being closed after each mail sending. If this is set to true then to close the connection requires an explicit call to SmtpClose().[/TD]
[/TR]
[/TABLE]
Also müsste man SmtpClose bei dir immer aufrufen!
 
Zurück
Oben