mrdee 1 Report post Posted October 26, 2007 Hello,I typed out a PHP script (literally copied from w3schools, the script is as follows: <html><body><?phpfunction spamcheck($field) {//eregi() performs a case insensitive regular expression match if(eregi("to:",$field) || eregi("cc:",$field)) { return TRUE; } else { return FALSE; } }//if "email" is filled out, send emailif (isset($_REQUEST['email'])) { //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); if ($mailcheck==TRUE) { echo "Invalid input"; } else { //send email $email = $_REQUEST['email']; $subject = $_REQUEST['subject']; $message = $_REQUEST['message']; mail("info@vlaanderen=flanders.org.uk", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; } }else//if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> Email: <input name='email' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> </textarea><br /> <input type='submit' /> </form>"; }?></body></html> Yet, when I run it, I keep getting the following error:Warning: mail() [function.mail]: SMTP server response: 530 Authenticate before sending emails. in C:\Program Files\Abyss Web Server\htdocs\mailform.php on line 34Thank you for using our mail form.Judiging by the last line, the script continues to run after the error.Line 34 is this line:$message, "From: $email" );As I said before, I am very inexperienced in PHP (a complete beginner), so I do not understand why I am getting this error.Any help will be very much appreciated.Thank you. Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted October 26, 2007 Does this help at all?http://forums.xisto.com/no_longer_exists/Seems you need to authenticate the SMTP connection. Might be easier to alter your server to use sendmail in the php.ini file. Share this post Link to post Share on other sites
mrdee 1 Report post Posted October 26, 2007 I'm afraid that link does not help, talks about using Googlemail.By the way, I forgot to mention: I am testing this program on my local machine, Using PHP 5.2 in conjunction with Apache server 2.2.Thanks. Share this post Link to post Share on other sites
pop 0 Report post Posted October 26, 2007 you need to setup php.ini file "smtp" (send mail transfer protocol) protocol. you can not send e-mail from your localhost computer, without connection to outside mail server. jlhalslip mentioned one way to setup smtp on your localmachine, by using google mail options as your default mail server. google mail is one of the fastest and largest mails, and i recomend you using the same. also if you have some host like trap18 you can also use their smpt details to setup your localhost mail connection. Share this post Link to post Share on other sites
mrdee 1 Report post Posted October 26, 2007 I see, well, I have hosting at Xisto.So, I could set these details up then?Thanks. Share this post Link to post Share on other sites