Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem ze skryptem emial
sepit22
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 3.03.2018

Ostrzeżenie: (0%)
-----


mam taki problem otóż kolega mi pomógł wszystko podpiąć pod moją stronę i dał mi kod php lecz coś nie działa może zle coś jest uzupełnione pomoże ktoś (IMG:style_emoticons/default/questionmark.gif) ?
<?php

include 'functions.php';

if (!empty($_POST)){

$data['success'] = true;
$_POST = multiDimensionalArrayMap('cleanEvilTags', $_POST);
$_POST = multiDimensionalArrayMap('cleanData', $_POST);

//your email adress
$emailTo ="konradlasak@wp.pl"; //"konradlasak@wp.pl";

//from email adress
$emailFrom ="konradlasak@wp.pl"; //"konradlasak@wp.pl";

//email subject
$emailSubject = "PolishWariors";

$name = $_POST["name"];
$email = $_POST["email"];
$comment = $_POST["comment"];
if($name == "")
$data['success'] = false;

if (!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $email))
$data['success'] = false;


if($comment == "")
$data['success'] = false;

if($data['success'] == true){

$message = "NAME: $name<br>
EMAIL: $email<br>
COMMENT: $comment";


$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html; charset=utf-8" . "\r\n";
$headers .= "From: <$emailFrom>" . "\r\n";
mail($emailTo, $emailSubject, $message, $headers);

$data['success'] = true;
echo json_encode($data);
}
}
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
markonix
post
Post #2





Grupa: Zarejestrowani
Postów: 2 707
Pomógł: 290
Dołączył: 16.12.2008
Skąd: Śląsk

Ostrzeżenie: (0%)
-----


U mnie działa.
Go to the top of the page
+Quote Post
Pyton_000
post
Post #3





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


na serwerze zapewne nie działa funkcja mail() ot i cały myk.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 2.10.2025 - 18:02