E-Mail mit WAMP und sendmail senden [duplizieren]

Diese Frage hat hier bereits eine Antwort:

PHP-Mail-Funktion schließt das Versenden von E-Mails nicht ab 24 Antworten

Ich habe WAMP unter Windows 8 installiert und versuche, E-Mails mit sendmail zu senden. Der Code gibt "email sent" zurück, das Testemail-Konto empfängt jedoch keine E-Mails in seinem Posteingang oder Spam-Ordner.

Dies ist meine sendmail.ini-Datei. (Ich habe 25.587.465 für den smtp_port und ssl ausprobiert, leer, keine, tls für den smtp_ssl.)

[sendmail]
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=mypassword
hostname=localhost

Dies ist die [Mail-Funktion] der Datei php.ini.

[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP =localhost 
; http://php.net/smtp-port
;smtp_port = 465

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = [email protected]

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path ="c:\wamp\sendmail\sendmail.exe -t -i"

Und das ist meine PHP-Datei zum Versenden von E-Mails

<?php
$to = '[email protected]';
$subject='testing';
$message = 'This is a test';

$headers  = 'From: [email protected]' . "\r\n" .
        'Reply-To: [email protected]' . "\r\n" .
        'MIME-Version: 1.0' . "\r\n" .
        'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();

if(mail($to,$subject,$message,$headers))
{
    echo "email sent";
}
else 
{
echo "Invalid Email";
}

?>

Das bekomme ich in meine Debug-Log-Datei

14/11/12 12:25:11 ** --- MESSAGE BEGIN ---
14/11/12 12:25:11 ** To: [email protected]
14/11/12 12:25:11 ** Subject: testing
14/11/12 12:25:11 ** X-PHP-Originating-Script: 0:email.php
14/11/12 12:25:11 ** From: [email protected]
14/11/12 12:25:11 ** Reply-To: [email protected]
14/11/12 12:25:11 ** MIME-Version: 1.0
14/11/12 12:25:11 ** Content-type: text/html; charset=iso-8859-1
14/11/12 12:25:11 ** X-Mailer: PHP/5.3.13
14/11/12 12:25:11 ** 
14/11/12 12:25:11 ** This is a test
14/11/12 12:25:11 ** --- MESSAGE END ---
14/11/12 12:25:11 ** Connecting to smtp.gmail.com:25
14/11/12 12:25:12 ** Disconnected.
14/11/12 12:25:12 ** Disconnected.
14/11/12 12:25:12 ** Socket Error # 10061<EOL>Connection refused.

Ich habe versucht, nach der Lösung zu googeln und meine sendmail.exe so einzustellen, dass sie mit Administratorrechten ausgeführt wird. Ich habe auch den IMAP-Zugriff auf [email protected] aktiviert. Kann mir jemand dabei helfen?

Antworten auf die Frage(1)

Ihre Antwort auf die Frage