Guest Rebel Posted May 11, 2015 Posted May 11, 2015 I have tried allot of php mail forms on my website but nothing works, im not receiving any emails what ever i do.On a other forum they say that my mail-function() is not working and i need to contact heliohost.So does anybody know what the problem is.
Byron Posted May 11, 2015 Posted May 11, 2015 I just checked and both servers are sending mail with the php mail() function. This should work for you as a test: <?php $to = "YOUR_EMAIL@gmail.com"; $subject = "Test Email"; $message = "Sending A Test Email."; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $headers .= "From: YOU@heliohost.org" . "\r\n" . "BCC: $maillist\n"; if (mail($to, $subject, $message, $headers)) { echo "<br><p><b>Message successfully sent!</b></p><hr><br>"; echo "From: YOU<br>"; echo "To: Me<br>"; echo "Bcc: $bcc<br>"; echo "Subject: $subject<br>"; echo "Message: $message<br>"; exit; } else { echo "<p>Message delivery failed...</p>"; } ?>
Guest Rebel Posted May 11, 2015 Posted May 11, 2015 Yes this works, i already tried something the same that worked also.But not when i use scripts from internet with forms to fill in, i tried like 12 different ones. Like this one, this one used to work on other servers years ago: <? error_reporting(E_ALL); if (isset($_POST['submit'])) { if (empty($_POST['naam']) OR empty($_POST['replyemail']) OR empty($_POST['inhoud'])) { print("Vul het veld helemaal in. <br />[<a href=\"JavaScript:history.back(-1)\">terug</a>]"); } elseif(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$",$_POST['replyemail'])) { print("Vul een geldig emailadres in"); } else { $headers .= "From: <Mijn naam - Website >\n"; $headers .= "X-Sender: <$replyemail>\n"; $headers .= "X-Mailer: PHP\n"; $headers .= "X-Priority: 1\n"; $headers .= "Return-Path: <$replyemail>\n"; $ip = $_SERVER['REMOTE_ADDR']; $inhoud = " De Gegevens: Naam: ".$_POST['naam']." Emailadres: ".$_POST['replyemail']." IP adres: $ip Het Bericht: $bericht"; mail ("mijnemail@live.nl","Het Gastenboek.",$inhoud,$headers); echo "<script language=\"javascript\"> window.alert ('Verzonden'); </script>"; //automatisch een mailtje terugzenden... $headers2 .= "From: <mijn naam - Website>\n"; $headers2 .= "X-Sender: <mijn email>\n"; $headers2 .= "X-Mailer: PHP\n"; $headers2 .= "X-Priority: 1\n"; $headers2 .= "Return-Path: <mijn email>\n"; $onderwerp2 .= "Bevestigings Email."; $bericht2 .= "Beste $naam, Je bericht is ontvangen! Het wordt eerst gelezen door mij. Als het een GOED bericht is, zal het worden geplaatst in Het Gastenboek. Met vriendelijke groeten, Mijn naam http://www.site.tk"; mail ($_POST['replyemail'],$onderwerp2,$bericht2,$headers2); } } ?>
Byron Posted May 11, 2015 Posted May 11, 2015 Here's one I made a long time ago that you can have. You'll need to do some editing in a few places, like your email address and such. This is what it looks like:http://bybyron.net/helio/email_form.php You can just upload this to your site and edit it to suit you:http://bybyron.net/helio/email_form.txt
Guest Rebel Posted May 17, 2015 Posted May 17, 2015 OK this email form does work.but the whole validation does not work, not even on your own site.when you write only your name press send it doesnt say anything it just clears the whole form.
Byron Posted May 17, 2015 Posted May 17, 2015 Ok it should work now: http://bybyron.net/helio/email_form.txt
Byron Posted May 18, 2015 Posted May 18, 2015 It works. The example also works. You must have had the the old files in your cache. Here's a new text file to download. http://bybyron.net/2/email_form.txt
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now