filburt1
Jan 30th, 2002, 07:58 PM
"Pretend" just for a second that I installed PHP 4 and have no clue how to write PHP code. Having said that :D, how would I go about writing a page that sends an e-mail to somebody@somedomain.com? I tried some of Chris's code but debugging it gets screwed in the bold line and I'd prefer another method JIC this one never works (he did say it was designed for php3).
<?php
/* recipients */
$to = "Arien Talabac <my.real@emailaddress.com>" ;
/* 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 <my.real@emailaddress.com>\n";
/* and now mail it */
mail($to, $subject, $message, $headers); // Says a "server error"
?>
The code above is at http://www.turtletips.com/phppages/sendmail.php. I have successfully run a "Hello, world" program so at least PHP is installed right. :confused:
<?php
/* recipients */
$to = "Arien Talabac <my.real@emailaddress.com>" ;
/* 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 <my.real@emailaddress.com>\n";
/* and now mail it */
mail($to, $subject, $message, $headers); // Says a "server error"
?>
The code above is at http://www.turtletips.com/phppages/sendmail.php. I have successfully run a "Hello, world" program so at least PHP is installed right. :confused: