A little help! (sending email)

Hello everyone!

I’m new here and very new to php and I have a little problem with my php/html thingy. :)

I’m trying to make this form that will allow you to send email.

So it’s basicly something like this.

My email: (any address)
Your email: (any address)
Subject:
Message:

And, I’ve been searching for something similar so I can change it fit my needs. And I found one that’s pretty close but it doesn’t work. I don’t know what is wrong with it. There are no error messages but it won’t send the mail.

you can find the files i’m working on in

http://www.sepankyla.com/php/lomake.html
http://www.sepankyla.com/php/lomake.php
http://www.sepankyla.com/php/kiitos.html

and here is the lomake.php

<?php session_start(); $myemail = "[email protected]"; $spam_blocks = array("EIROSKAA","NOSPAM"); if (isset($_SESSION["form_time"]) and $_SESSION["form_time"] > time()) die ("Virhe: Roskapostittamisen est?¤miseksi on sallittua l?¤hett?¤?¤ vain yksi viesti per 10 minuuttia."); if (isset($_POST)) $data = $_POST; elseif (isset($HTTP_POST_VARS)) $data = $HTTP_POST_VARS; if ((!isset($_POST) and !isset($HTTP_POST_VARS)) or count($data) == 0) die ("Virhe: Lomakedataa ei l?¶ytynyt."); foreach($data as $key => $value) { if($key == "recipient") { $recipient = $value; foreach ($spam_blocks as $array) $recipient = str_replace($array, "", $recipient); } elseif($key == "email") $email = $value; elseif($key == "subject") $subject= $value; elseif($key == "redirect") $redirect = $value; elseif ($value != "") $msg .= "$key: ". chr(13). chr(10) ."$valuenn"; if (strlen($msg) > 50000) die ("Virhe: Viesti on liian pitk?¤ (yli 50000 merkki?¤)."); } if ($msg == "") die ("Virhe: L?¤hetit tyhj?¤n lomakkeen."); else $msg = "WWW-LOMAKKEELLA L?„HETETYT TIEDOT: nn" . $msg . "L?¤hett?¤j?¤n IP-numero: " . getenv("REMOTE_ADDR"); if (!isset($recipient) and $myemail != "") $recipient = $myemail; if (isset($recipient)) { mail ($recipient, $subject, $msg, "From: ". $email); $_SESSION["form_time"] = time() + 60 * 10; if (isset($redirect)) header("Location: $redirect"); else print "Viestisi on l?¤hetetty. Kiitos yhteydenotosta."; } else die ("Virhe: Vastaanottajan s?¤hk?¶postiosoite puuttuu."); ?>

Any help would be appreciated.

Sponsor our Newsletter | Privacy Policy | Terms of Service