Jump to content

[SOLVED] Unknown Mail Error


lszanto

Recommended Posts

I am working on a site and for some reason the mail function keeps returning false for no reason when all the input is correct and should be sending, the script is below.

 

<?php

//If form submitted.
					if(isset($_POST['name']) && isset($_POST['url']) && empty($_POST['agree'])) {
						//Get/set vars.
						$name = $_POST['name'];
						$url = $_POST['url'];
						$perms = $_POST['perms'];
						$subject = "Pleasing Page Submission";
						$to = "[email protected]";
						$from = "From: <Pleasing Pages>";

						//Check for perms.
						if($perms == "on") {
							$perms = "You have owners permission.";
						} else {
							$perms = "You need to contact the owner and get permission.";
						}

						//Make email.
						$message = "You have recieved a page that has pleased $name\n\nName: $name\nPleasing Page: $url\nPermission: $perms\n\nThanks, Pleasing Pages";

						//Make mail var.
						$mail = mail($subject, $to, $message, $from);

						//Check if sent.
						if($mail) {
							//Sent.
							echo "$url has been sucessfully submitted.";
						}  else {
							//Didn't send.
							echo "An error has occured, please go <a href=\"http://lszanto.hosttds.com/wordpress/please-us/\" >back</a> and try again.";
						}
					} else {
						echo "<script> window.location = 'http://lszanto.hosttds.com'; </script><noscript><meta http-equiv=\"refresh\" content=\"0;url=http://lszanto.hosttds.com\" /></noscript>";
					}

?>

Link to comment
https://forums.phpfreaks.com/topic/72057-solved-unknown-mail-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.