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 [email protected]"; // 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] Link to comment https://forums.phpfreaks.com/topic/29859-mail/ Share on other sites More sharing options...
matto Posted December 8, 2006 Share Posted December 8, 2006 is the server setup to send mail ? Link to comment https://forums.phpfreaks.com/topic/29859-mail/#findComment-137195 Share on other sites More sharing options...
chriscloyd Posted December 8, 2006 Author Share Posted December 8, 2006 yeslol Link to comment https://forums.phpfreaks.com/topic/29859-mail/#findComment-137197 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] Link to comment https://forums.phpfreaks.com/topic/29859-mail/#findComment-137202 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 Link to comment https://forums.phpfreaks.com/topic/29859-mail/#findComment-137209 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. Link to comment https://forums.phpfreaks.com/topic/29859-mail/#findComment-137212 Share on other sites More sharing options...
chriscloyd Posted December 8, 2006 Author Share Posted December 8, 2006 yaphpinfo();what do i look for Link to comment https://forums.phpfreaks.com/topic/29859-mail/#findComment-137215 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? Link to comment https://forums.phpfreaks.com/topic/29859-mail/#findComment-140052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.