Page 1 of 1

Email ?

Posted: Fri Mar 18, 2005 3:46 am
by russellbcv
Hi

I am having problems sending this email using a very basic form. I have configured the php.ini file to reflect the correct smtp server but I keep getting a error in line 9 of my .php script? Am I missing a header?

Please can somebody double check my script & configuration data to see if there are any errors.

Thanks

Code: Select all

їmail function]
; For Win32 only.
SMTP = 127.26.1.2
smtp_port = 25

; For Win32 only.
sendmail_from = enquiries@midastelecom.ws

Code: Select all

їFri Mar 18 08:32:11 2005] їerror] PHP Warning:  mail() ї<a href='function.mail'>function.mail</a>]: "sendmail_from" not set in php.ini or custom "From:" header missing in c:\\Apache\\htdocs\\feedback.php on line 9

Code: Select all

<html>
  <head> <title>Feedback Form</title> </head>
  <body>
    <form action=&quote;feedback.php&quote; method=&quote;post&quote;>
    Name:<input type=&quote;text&quote; name=&quote;username&quote; size=&quote;30&quote;>
    <br> <br>
    Email:<input type=&quote;text&quote; name=&quote;useraddr&quote; size=&quote;30&quote;>
    <br> <br>
    <textarea name=&quote;comments&quote; cols=&quote;30&quote; rows=&quote;5&quote;>
    </textarea><br>
    <input type=&quote;submit&quote; value=&quote;Send Form&quote;>
   </form>
  </body>
</html>

Code: Select all

<?php
     $username = $_POSTї'username'];
     $useraddr = $_POSTї'useraddr'];
     $comments = $_POSTї'comments'];
     
     $to = &quote;enquiries@midastelecom.ws&quote;;
     $re = &quote;Website Feedback&quote;;
     $msg = $comments;
     mail( $to, $re, $msg );
 ?>
 
 <html>
      <head><title>Message Received</title></head>
      <body>
      <h1>Thanks for your comments</h1>
      Message received from <?php echo( $username ); ?>
      <br>
      Reply to <?php echo( $useraddr ); ?>
      </body>
</html>

feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Fri Mar 18, 2005 7:59 am
by feyd
Moved to PHP - Code.