Hallo alle.
Ik ben bezig met het verzenden van mail dmv php. NU heb ik alleen 1 klein probleem. Ik werk in een server omgeving met een exchange mail server.
Nu krijg ik de volgende melding:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\mail.php on line 29
<?php
$plainoutput = "bla bla bla";
$htmloutput = "<html><body>Html tekst voorlopig</body></html>";
$email = "[email protected]";
$subject = "Onderwerp";
//HEADER
$header = "From: Je Naam <[email protected]>\n";
$header .= 'X-Mailer: PHP/' . phpversion() . "\n";
//BOUNDARY GENEREREN
$boundary = "==String_Boundary_x" .md5(time()). "x";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: multipart/alternative;\n";
$header .= " boundary=\"$boundary\";\n\n";
// PLAIN
$message .= "--$boundary\n";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= "$plainoutput\n\n";
// HTML
$message .= "--$boundary\n";
$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= "$htmloutput\n\n";
$message .= "--$boundary--\n"; <-------- Line 29!
mail($email, $subject, $message, $header);
?>
Waarschijnlijk staan mijn instellingen in de php.ini verkeerd ingesteld maar wat zou dat dan moeten wezen om het wel goed te laten werken?
Dit is php.ini
[mail function]
; For Win32 only.
SMTP = localhost
; For Win32 only.
sendmail_from =
; For Win32 only.
smtp_port = 25
Alvast bedankt voor jullie reactie!
1.553 views