Jump to content

Recommended Posts

Guest Rebel
Posted

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.

Posted

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

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);
 }
}
?>

Guest Rebel
Posted

yheah but why isnt it working?

Guest Rebel
Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...