send email problem

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
andrewsheldon98
-


Joined: 09 May 2003
Posts: 2

PostPosted: Fri May 09, 2003 6:54 am    Post subject: send email problem Reply with quote

Code:

<?
if ($Email) {
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
if($Name=="" || $Email=="" || $Comment=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($errors==1) echo $error;
else{
$message="Name: ".$Name."
Email: ".$Email."
Comment: ".$Comment."
";
mail("mail@scpa.co.uk","Form Submitted at your website",$message,"From: phpFormGenerator");
header("Refresh: 0;url=http://www.scpa.co.uk/thankyou.php");
}
}
else {
?>
<form action="<?php $PHP_SELF ?>" method=post>
Name<input type=text name='Name'>
Email<input type=text name='Email'>
Comment<textarea name='Comment' rows=5 cols=40></textarea>
<input type=submit value='Submit Form'></form>

<?php
}
?>


Above is the script but when i submit the email the form resets its self with no errors.
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat May 10, 2003 12:36 am    Post subject: Re: send email problem Reply with quote

Edit your php.ini file and locate the line beginning with register_globals and set it to register_globals=on .
For more information, search for register_globals on that forum .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
andrewsheldon98
-


Joined: 09 May 2003
Posts: 2

PostPosted: Sat May 10, 2003 3:46 am    Post subject: Reply with quote

doesnt work when i try that.
Back to top View user's profile Send private message
s1asher
-


Joined: 20 Mar 2003
Posts: 53

PostPosted: Sat May 10, 2003 10:56 am    Post subject: Reply with quote

Have you specified an SMTP server/sendmail_path in php.ini?
If your using a windows host, then you should set:

Code:
[mail function]
; Setup for Windows systems
SMTP = smtp.my.isp.net
sendmail_from = me@myserver.com


If you are using your own mail server, set the smtp.my.isp.net to localhost and you can change the sendmail_from to your desired email address. remember to keep the sendmail_path deactivated by keeping the ; before it.

I dont fully know how to use the sendmail_path is your running Linux (or other Unix based OS). If this is the case then perhaps someone else can post the answer.
Hope this Helps
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group