{"id":891,"date":"2024-09-19T09:15:03","date_gmt":"2024-09-19T08:15:03","guid":{"rendered":"http:\/\/ghanim-solution.de\/?p=891"},"modified":"2024-09-19T09:15:03","modified_gmt":"2024-09-19T08:15:03","slug":"so-konfigurierst-du-gmail-smtp-in-wordpress-ohne-plugin","status":"publish","type":"post","link":"https:\/\/ghanim-solution.de\/index.php\/2024\/09\/19\/so-konfigurierst-du-gmail-smtp-in-wordpress-ohne-plugin\/","title":{"rendered":"So konfigurierst du Gmail-SMTP in WordPress ohne Plugin"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Wenn du E-Mails von deinem WordPress-Blog \u00fcber Gmail verschicken m\u00f6chtest, aber kein Plugin verwenden willst, kannst du dies direkt \u00fcber den SMTP-Server von Gmail konfigurieren. Hier ist eine Schritt-f\u00fcr-Schritt-Anleitung, wie du Gmail als SMTP-Server in WordPress einrichtest.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li class=\"has-large-font-size\">WordPress f\u00fcr SMTP vorbereiten<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Um die SMTP-Funktionalit\u00e4t in WordPress zu aktivieren, musst du in deiner <code>wp-config.php<\/code> einige Konstanten festlegen, die die SMTP-Details von Gmail enthalten.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u00d6ffne deine <strong><code>wp-config.php<\/code><\/strong> und f\u00fcge folgende Zeilen hinzu:<\/p>\n\n\n\n<pre><code class=\"language-php\">\ndefine( 'SMTP_USER',   'example@gmail.com' );    \/\/ Dein Gmail-Benutzername\ndefine( 'SMTP_PASS',   'App-passwort' );           \/\/ Dein App-spezifisches Passwort\ndefine( 'SMTP_HOST',   'smtp.gmail.com' );         \/\/ Gmail SMTP-Host\ndefine( 'SMTP_FROM',   'example@gmail.com' );     \/\/ Absender-E-Mail\ndefine( 'SMTP_NAME',   'Ihr Name' );               \/\/ Absendername\ndefine( 'SMTP_PORT',   '587' );                    \/\/ SMTP-Port (f\u00fcr TLS)\ndefine( 'SMTP_SECURE', 'TLS' );                    \/\/ Verschl\u00fcsselungsmethode\ndefine( 'SMTP_AUTH',    true );                    \/\/ SMTP-Authentifizierung aktivieren\ndefine( 'SMTP_DEBUG',   0 );                       \/\/ Debug-Modus, auf 1 oder 2 setzen f\u00fcr mehr Informationen\n\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>SMTP_USER<\/code><\/strong>: Deine Gmail-Adresse.<\/li>\n\n\n\n<li><strong><code>SMTP_PASS<\/code><\/strong>: Dein App-spezifisches Passwort, wenn du die Zwei-Faktor-Authentifizierung verwendest.<\/li>\n\n\n\n<li><strong><code>SMTP_HOST<\/code><\/strong>: Der SMTP-Server von Gmail.<\/li>\n\n\n\n<li><strong><code>SMTP_PORT<\/code><\/strong>: Verwende <code>587<\/code> f\u00fcr TLS-Verschl\u00fcsselung (empfohlen).<\/li>\n\n\n\n<li><strong><code>SMTP_SECURE<\/code><\/strong>: Gib <code>TLS<\/code> an, um eine sichere Verbindung herzustellen.<\/li>\n\n\n\n<li><strong><code>SMTP_AUTH<\/code><\/strong>: Muss auf <code>true<\/code> gesetzt sein, damit die SMTP-Authentifizierung aktiviert wird.<\/li>\n<\/ul>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\">2. <strong>SMTP in WordPress konfigurieren<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Um sicherzustellen, dass WordPress SMTP verwendet, musst du eine Funktion in der Datei <strong><code>functions.php<\/code><\/strong> deines Themes hinzuf\u00fcgen. Diese Funktion stellt sicher, dass WordPress deine Gmail-Einstellungen verwendet:<\/p>\n\n\n\n<pre><code class=\"language-php\">\nadd_action( 'phpmailer_init', 'send_smtp_email' );\nfunction send_smtp_email( $phpmailer ) {\n    $phpmailer->isSMTP();\n    $phpmailer->Host       = SMTP_HOST;\n    $phpmailer->SMTPAuth   = SMTP_AUTH;\n    $phpmailer->Port       = SMTP_PORT;\n    $phpmailer->Username   = SMTP_USER;\n    $phpmailer->Password   = SMTP_PASS;\n    $phpmailer->SMTPSecure = SMTP_SECURE;\n    $phpmailer->From       = SMTP_FROM;\n    $phpmailer->FromName   = SMTP_NAME;\n}\n\n<\/code><\/pre>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\">3. <strong>Testen der SMTP-Verbindung<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bevor du diese Konfiguration verwendest, stelle sicher, dass alles korrekt funktioniert. Es ist empfehlenswert, den Debug-Modus in der <code>wp-config.php<\/code> vor\u00fcbergehend zu aktivieren, um m\u00f6gliche Fehler zu erkennen:<\/p>\n\n\n\n<pre><code class=\"language-php\">\ndefine( 'SMTP_DEBUG', 2 );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Dieser Wert gibt dir detaillierte Debugging-Informationen im WordPress-Fehlerprotokoll. Nachdem alles funktioniert, kannst du den Debug-Modus wieder deaktivieren.<\/p>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\">4. <strong>Warum ein App-Passwort?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Wenn du die Zwei-Faktor-Authentifizierung bei deinem Gmail-Konto aktiviert hast, funktioniert dein normales Passwort nicht. Du musst ein <strong>App-spezifisches Passwort<\/strong> erstellen, um es in WordPress zu verwenden:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Gehe zu deinem <a href=\"https:\/\/myaccount.google.com\/\">Google-Konto<\/a><\/li>\n\n\n\n<li>.Klicke auf <strong>Sicherheit<\/strong> und dann auf <strong>App-Passw\u00f6rter<\/strong>.<\/li>\n\n\n\n<li>Erstelle ein neues App-Passwort und verwende dieses in deiner WordPress-Konfiguration.<\/li>\n<\/ul>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\">5. <strong>E-Mail testen<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nun, da alles eingerichtet ist, teste die E-Mail-Funktion, indem du eine Test-E-Mail \u00fcber WordPress sendest, beispielsweise mit einem Kontaktformular oder einem einfachen Code in einem Beitrag oder einer Seite:<\/p>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\">Fazit<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Die Konfiguration von Gmail-SMTP in WordPress ohne Plugin ist eine effektive M\u00f6glichkeit, sicherzustellen, dass deine E-Mails korrekt versendet werden. Wenn du die oben genannten Schritte befolgst, kannst du E-Mails direkt \u00fcber den Gmail-Server senden.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Wichtiger Hinweis<\/strong>: Falls du auf Probleme st\u00f6\u00dft oder die E-Mails nicht korrekt gesendet werden, \u00fcberpr\u00fcfe das Debug-Log und pr\u00fcfe, ob alle SMTP-Einstellungen richtig konfiguriert sind.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wenn du E-Mails von deinem WordPress-Blog \u00fcber Gmail verschicken m\u00f6chtest, aber kein Plugin verwenden willst, kannst du dies direkt \u00fcber den SMTP-Server von Gmail konfigurieren. Hier ist eine Schritt-f\u00fcr-Schritt-Anleitung, wie du Gmail als SMTP-Server in WordPress einrichtest. Um die SMTP-Funktionalit\u00e4t in WordPress zu aktivieren, musst du in deiner wp-config.php einige Konstanten festlegen, die die SMTP-Details [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":892,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-891","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/posts\/891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/comments?post=891"}],"version-history":[{"count":1,"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/posts\/891\/revisions"}],"predecessor-version":[{"id":893,"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/posts\/891\/revisions\/893"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/media\/892"}],"wp:attachment":[{"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/media?parent=891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/categories?post=891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ghanim-solution.de\/index.php\/wp-json\/wp\/v2\/tags?post=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}