sendmail newbie question
Posted: Wed Jan 26, 2005 10:51 pm
i finally installed php support for my apache server with help from http://www.thesitewizard.com/
now im trying to write his code for a sendmail form but having issues
i have 2 files one is index.php
the second is sendmail.php
the code i have for index. php is
<html>
<title>Hello</title>
<body>
<form method="post" action="sendmail.php">
Email: <input name="email" type="text" /><br />
Message:<br />
<textarea name="message" rows="15" cols="40">
</textarea><br />
<input type="submit" />
</form>
</body>
</html>
the code for sendmail.php is
<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
mail( "littlebill@littlebill.shacknet.nu", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://www.yahoo.com" );
?>
this is the error i get
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in c:\documents and settings\littlebill\desktop\webpage\sendmail.php on line 6
Warning: Cannot modify header information - headers already sent by (output started at c:\documents and settings\littlebill\desktop\webpage\sendmail.php:6) in c:\documents and settings\littlebill\desktop\webpage\sendmail.php on line 7
this is what i have load in the php.ini on the apache server
[mail function]
; For Win32 only.
SMTP = smtp.littlebill.shacknet.nu
smtp_port = 25
; For Win32 only.
;sendmail_from = LittleBill@littlebill.shacknet.nu
this is apache on a xp computer
now am i have a syntax error or is this a mail server issue, as my users have to authenticate to send, the mail server is not an open relay, but i switched it to open relay with no luck, any help would be greatly appreicated
you can find the above program at
http://littlebill.shacknet.nu:81/index.php
again i would really appreciate it
now im trying to write his code for a sendmail form but having issues
i have 2 files one is index.php
the second is sendmail.php
the code i have for index. php is
<html>
<title>Hello</title>
<body>
<form method="post" action="sendmail.php">
Email: <input name="email" type="text" /><br />
Message:<br />
<textarea name="message" rows="15" cols="40">
</textarea><br />
<input type="submit" />
</form>
</body>
</html>
the code for sendmail.php is
<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
mail( "littlebill@littlebill.shacknet.nu", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://www.yahoo.com" );
?>
this is the error i get
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in c:\documents and settings\littlebill\desktop\webpage\sendmail.php on line 6
Warning: Cannot modify header information - headers already sent by (output started at c:\documents and settings\littlebill\desktop\webpage\sendmail.php:6) in c:\documents and settings\littlebill\desktop\webpage\sendmail.php on line 7
this is what i have load in the php.ini on the apache server
[mail function]
; For Win32 only.
SMTP = smtp.littlebill.shacknet.nu
smtp_port = 25
; For Win32 only.
;sendmail_from = LittleBill@littlebill.shacknet.nu
this is apache on a xp computer
now am i have a syntax error or is this a mail server issue, as my users have to authenticate to send, the mail server is not an open relay, but i switched it to open relay with no luck, any help would be greatly appreicated
you can find the above program at
http://littlebill.shacknet.nu:81/index.php
again i would really appreciate it