Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

PHP Mail error!?!

  • 29-12-2006 4:01pm
    #1
    Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭


    Keeps saying that all the four topics are missing like there is nothin in them, the names on the input fields on the previous page all match the variables on this page!??
    <?php
    		$msg = "Thank you for contacting us.\n";
    		$msg .= "Your entries were as follows -\n";
    		if($name)
    		{
    			$name = "Name: $name";
    			$msg .= "$name\n";
    		}
    		else
    		{
    			$error = "- Name Missing.<br>\n";
    		}
    		if($email)
    		{
    			$email = "E-Mail: $email";
    			$msg .= "$email\n";
    		}
    		else
    		{
    			$error .= "- E-Mail Missing.<br>\n";
    		}
    		if($subject)
    		{
    			$subject = "Subject: $subject";
    			$msg .= "$subject\n";
    		}
    		else
    		{
    			$error .= "- Subject Missing.<br>\n";
    		}
    		if($message)
    		{
    			$message = "Message: $message";
    			$msg .= "$message\n";
    		}
    		else
    		{
    			$error .= "- Message Missing.<br>\n";
    		}
    		if($error == "")
    		{
    			echo'Thank you for contacting Us.';
    			mail("info@site.ie", "$subject", $msg, "From: $email");
    		}
                    else
    		{
    			print "Please fill in the missing fields - <br>\n";
    			print "$error<br>\n";
    			print "<br>\n";
    			print "<br>\n";
    			print "Please use your \"Back\" button to return to the form to correct the omissions.<br>\n";
    		}
    ?>
    


Comments

  • Registered Users, Registered Users 2 Posts: 32,136 ✭✭✭✭is_that_so


    use
    print $variablename;
    exit;

    to check what each variable contains before mailing it.


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    Where are you collecting the variables from? $name isn't collected anywhere. Do you mean $_GET or $_POST? Depends on the form method from the previous page!


Advertisement