XAMPP: Sendmail (PHP-Mailversand) für Windows konfigurieren

Unter Windows ist es kein Kinderspiel einen Mailserver aufzusetzen, welcher E-Mails versendet und die von großen E-Mail-Providern, wie zum Beispiel GMX oder WEB durchgelassen werden. Oft stimmen die Relay-Hosts nicht oder das Auflösen der privaten IP-Adresse schlägt fehl. Die IP-Adressen von privaten Internetanbindungen sind nicht in den WhiteLists der Anbieter eingetragen und so werden die versendeten E-Mails meist abgewiesen oder landen direkt im Spam-Ordner.

Für einen Webentwickler ist der E-Mailversand dennoch ein elementarer Bestandteil bei der Entwicklung von Internetauftritten. Beispielsweise werden E-Mails durch ein Kontaktformular versandt oder bei der Registrierung eines Benutzers, werden die Double-Opt-In E-Mails zur Aktivierung, etc. versandt. Wer die Softwarepakete "XAMPP" unter Windows nutzt, hat die Möglichkeit MercuryMail oder Sendmail zu konfigurieren. Bis allerdings MercuryMail eingerichtet ist, ist es oft schneller mit einem externen Dienstleister, wie beispielsweise All-Inkl.com, getan. Wer einen Shared-Server bei All-Inkl.com besitzt und eh ein Postfach dort eingerichtet hat, kann über das E-Mailpostfach kinderleicht E-Mails versenden. So wird PHP später über Sendmail und dem externen SMTP-Server die E-Mails an die entsprechenden Empfänger versenden und erfolgreich zugestellt, da der Relay-Host (Mailserver) korrekt aufgelöst werden kann und auch in den Whitelists der großen Provider steht.

Ein kleines HowTo zur Einrichtung von Sendmail gibt es hier.
Die Einrichtung von Sendmail basiert auf der XAMPP Version 1.7.3.
Bei den Pfaden gehen wir davon aus, dass XAMPP unter C:\xampp\ zur Verfügung steht.

Sendmail.ini: C:\xampp\sendmail\sendmail.ini
PHP.ini: C:\xampp\php\php.ini

Konfiguration der sendmail.ini für SMTP-Dienst für all-inkl.com

  1. span style="color: #666666;">"C:\xampp\sendmail\sendmail.log"
  2.  
  3. #allinkl
  4. # Set a default account

Konfiguration mit Hotmail:

  1. span style="color: #666666;">"C:\xampp\sendmail\sendmail.log"
  2.  
  3. # A freemail service example
  4. # Set a default account

Konfiguration mit GMX:

  1. span style="color: #666666;">"C:\xampp\sendmail\sendmail.log"
  2.  
  3. # A freemail service GMX
  4. account gmx
  5. tls on
  6. tls_certcheck off
  7. host smtp.gmx.net
  8. from exampleuser@gmx.de
  9. auth on
  10. user exampleuser@gmx.de
  11. password examplepassword
  12.  
  13. # Set a default account

Des Weiteren müsst ihr in der php.ini die Zeilen mit "sendmail" anpassen und freischalten.

  1. sendmail_path = "C:\xampp\sendmail\sendmail.exe -t"
  1. SMTP = localhost
  1. smtp_port = 25
  1.  

Sind alle Konfigurationen durchgeführt, vergesst euren Apache-Dienst nicht neuzustarten. Ohne Neustart werden die Änderungen nicht wirksam.

// Update:

Einrichtung von Sendmail mit Google-Mail-Account(sendmail.ini) unter XAMPP 1.8.0

#GMAIL mit XAMPP 1.8.0 und sendmail
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=xxx.xxx@gmail.com
auth_password=xxxxx
;force_sender=xxx.xxx@gmail.com
smtp_ssl=tls
tls_certcheck off 

PHP 5.4.x (php.ini) in Verbindung mit sendmail

[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
; SMTP = localhost
; smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = xxx.xxx@gmail.com

; XAMPP IMPORTANT NOTE (1): If XAMPP is installed in a base directory with spaces (e.g. c:\program files\xampp) fakemail and mailtodisk do not work correctly.
; XAMPP IMPORTANT NOTE (2): In this case please copy the sendmail or mailtodisk folder in your root folder (e.g. C:\sendmail) and use this for sendmail_path.  
 
; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
sendmail_path = "C:\"\xampp\sendmail\sendmail.exe\" -t"
; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the \xampp\mailoutput folder
;sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe"

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off

; Log all mail() calls including the full path of the script, line #, to address and headers
mail.log = "C:\xampp\php\logs\php_mail.log"

Tags: , , , , , , , ,

6 Antworten auf "XAMPP: Sendmail (PHP-Mailversand) für Windows konfigurieren"

  • onip says:
  • Reinhardt says:
  • Marco says:
  • Maren Lange says:
  • Sascha says:
  • Johannes says:
Hinterlasse eine Nachricht