ich habe folgende Einstellungen durchgeführt:
php.ini:
Zitat:
[mail function]
...
SMTP = localhost
...
smtp_port = 25
sendmail_from = me@mydomain.com
...
mail.add_x_header = Off
...
mail.log = "C:\xampp\apache\logs\php_mail.log"
|
habe den System Pfad mit php und senmail Pfade versehen:
Zitat:
|
;C:\xampp\php;C:\xampp\sendmail;
|
UNd mein Script sieht wie folgt aus:
PHP-Code:
$to = "ziel@domain.com";
$from = "me@mydomain.com";
$subject = "Hello! This is HTML email";
ini_set('SMTP', 'localhost');
ini_set('smtp_port', 25);
$myVar = "Bla bla bla...";
$message =
<<<EOF
<html>
<body bgcolor="#DCEEFC">
<center>
<b>Looool!!! I am reciving HTML email......</b> <br>
<font color="red">Thanks $myVar!</font> <br>
<a href="http://www.google.com/"> $myVar</a>
</center>
<br><br>*** Now you Can send HTML Email <br> Regards<br>$myVar
</body>
</html>
EOF;
//end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
// now lets send the email.
mail($to, $subject, $message, $headers);
echo "Message has been sent....!";
Ich habe nicht nur den gesamten Rechner neugestartet. Ich kriege aber diesen Fehler:
Zitat:
PHP Warning: mail(): Failed to connect to mailserver at "localhost" port 25, ve
rify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\Tests\Mailer\send_html_email.php on line 31
Message has been sent....!
|
Hat jmd ne Idee wie ich dies Problemchen lösen kann?
Grüße
Aha