chriscloyd Posted December 8, 2006 Share Posted December 8, 2006 i need help the mail() is not working for meHeres my script it goes to the correct page after which is index.php?page=finsh_add_projectbut i dont get an email[code]<?phpinclude("../includes/functions.php");include("../db.php");if ($_POST['first'] == NULL) { $reason = "No first name entered<br />"; header("Location: index.php?addproject&reason=$reason");} elseif ($_POST['last'] == NULL) { $reason = "No last name entered<br />"; header("Location: index.php?addproject&reason=$reason");} elseif ($_POST['email'] == NULL) { $reason = "No email address entered<br />"; header("Location: index.php?addproject&reason=$reason");}$password = genpassword(10);$pass = sha1(md5($password));$first = $_POST['first'];$last = $_POST['last'];$email = $_POST['email'];$create_client = mysql_query("INSERT INTO pm_clients (`first`,`last`,`email`,`password`) VALUES ('$first','$last','$email','$pass')");if ($create_client) { $from = "SRX Studios - Project Manager noreply@srxstudios.com"; // HTML body $body = '<img src="http://pm.srxstudios.com/images/image1.jpg" width="500" height="60"><br> <br><br>Hello " . $first ." ". $last . ", <p> <i>Your</i> info to login into the <a href="http://pm.srxstudios.com">Project Manager</a>.<p> Username: ".$email."<br> Password: ".$password."<br><br><br> <strong>Webmaster - SRX Studios</strong><br> . . . . . . . . . . . . . . . . . . . . . . . . . . .<BR> <strong>SRX Studios, LLC.</strong><strong><BR> <a href="http://srxstudios.com">http://www.srxstudios.com</a></strong>'; if(!mail($email,$subject,$message,"From $from")) { echo "There has been a mail error sending to " . $email . "<br>"; } else { $_SESSION['srxadd'] = $email; header("Location: ../index.php?page=finsh_add_project"); }} else { echo "error";}?>[/code] Quote Link to comment Share on other sites More sharing options...
matto Posted December 8, 2006 Share Posted December 8, 2006 is the server setup to send mail ? Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted December 8, 2006 Author Share Posted December 8, 2006 yeslol Quote Link to comment Share on other sites More sharing options...
doni49 Posted December 8, 2006 Share Posted December 8, 2006 I don't know if this is it, but the "Headers" portion (the 4th argument is not entered correctly.Change the following:[quote]mail($email,$subject,$message,"From $from")[/quote]to:[quote]mail($email,$subject,$message,"From:$from")[/quote]And just to confirm that your server IS able to send messages try the following:[quote]mail([b]"your_emailaddress"[/b],"Test Subject","This is a test message")[/quote] Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted December 8, 2006 Author Share Posted December 8, 2006 if i dont get one what can i do to make mail() work on my server Quote Link to comment Share on other sites More sharing options...
doni49 Posted December 8, 2006 Share Posted December 8, 2006 One step at a time. It's called trouble shooting. If the test message doesn't arrive after doing that, then I think that PHP is not configured to send email. Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted December 8, 2006 Author Share Posted December 8, 2006 yaphpinfo();what do i look for Quote Link to comment Share on other sites More sharing options...
matto Posted December 13, 2006 Share Posted December 13, 2006 You should see something like thissendmail_pathIs the server windows or unix? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.