-
PHP Learning
I've got this code:
PHP Code:
<?php
/* recipients */
$to = "Arien Talabac <[email protected]>" . ", " ; //note the comma
/* subject */
$subject = "Test Mail";
/* message */
$message = '
Test message
';
/* To send HTML mail, set the Content-type header. */
//$headers = "MIME-Version: 1.0\n";
//$headers = "Content-type: text/html; charset=iso-8859-1\n";
/* additional headers */
$headers = "From: TurtleTips Auto-Mailer <[email protected]>\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
?>
But I get an error on the last line (mail($to...):
PHP Code:
Warning: Server Error in d:\apacheroot\phppages\sendmail.php on line 22
I defined my SMTP server in the php.ini file to be mail.*****.**.home.com (replacing the *s :p) but it still doesn't work, and I can't find any error log to see what error was generated. :confused:
-
Where it says "//note the comma" Did you try ripping off the comma? The comma means you're going to send it to another recipient as well.
cudabean
-
No change. How can I find out more details about the error?
-
did you get rid of the dot as well, like
since that is the string concatenation char.
-
Yeah, but I still get that one error (well, warning). Does the PHP module have log files so I can see what "server error" occurred?
-
it must be some sort of config problem because PHP's compile errors are a lot more useful than that.
Anyway, check this for error log stuff
http://www.php.net/manual/en/ref.errorfunc.php
theres also a link by some guy for a handler class.
-
are you using Apache or IIS?
I also think you can't do this
$to = "Arien Talabac <[email protected]>" . ", " ; //note the comma
it needs to be this
$to = "[email protected]";
if you use apache it has it's own log file. check out what it says..
-
I'm using Apache, but there was nothing but 404s and Access Denied errors in the log file.