Zaloguj | Zarejestruj | FAQ
Anonymous

kontaktformular

+ Odpowiedz

Posty: 2 Strona 1 z 1


kontaktformular

przez novica » Pn lis 28, 2016 5:12 pm

hallo leute brauche dringend hilfe meine webseite ist online und der formular geht nicht

wo soll ich den meine daten eingeben

<?php

//SMTP server settings
$host = "smtp.world4you.com";
$port = "587";
$username = "office@flughafen-taxi.net";
$password = "habe ich schon ";


$messageBody = "";

if($_POST['name']!='false'){
$messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['name']!='false'){
$messageBody .= '<p>Country: ' . $_POST["country"] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['email']!='false'){
$messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}else{
$headers = '';
}
if($_POST['state']!='false'){
$messageBody .= '<p>State: ' . $_POST['state'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['phone']!='false'){
$messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['fax']!='false'){
$messageBody .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['message']!='false'){
$messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";
}

if($_POST["stripHTML"] == 'true'){
$messageBody = strip_tags($messageBody);
}

if($host=="" or $username=="" or $password==""){
$owner_email = $_POST["owner_email"];
$headers = 'From:' . $_POST["email"] . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n";
$subject = 'A message from your site visitor ' . $_POST["name"];

try{
if(!mail($owner_email, $subject, $messageBody, $headers)){
throw new Exception('mail failed');
}else{
echo 'mail sent';
}
}catch(Exception $e){
echo $e->getMessage() ."\n";
}
}else{
require_once 'Mail.php';

$to = $_POST["owner_email"];
$subject = 'A message from your site visitor ' . $_POST["name"];
$headers = array (
'From' => 'From:' . $_POST["email"] . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n",
'To' => $to,
'Subject' => $subject);

$smtp = Mail::factory(
'smtp',
array (
'host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));

$mail = $smtp->send($to, $headers, $messageBody);

try{
if(PEAR::isError($mail)){
echo $mail->getMessage();
}else{
echo 'mail sent';
}
}catch(Exception $mail){
echo $mail->getMessage() ."\n";
}
}



?? kann mit jemand helfe
?>
Avatar użytkownika

novica

  • Posty: 2
  • Dołączył(a): Pn lis 28, 2016 5:08 pm

Re: kontaktformular

przez novica » Pn lis 28, 2016 6:03 pm

novica napisał(a):hallo leute brauche dringend hilfe meine webseite ist online und der formular geht nicht

wo soll ich den meine daten eingeben

<?php

//SMTP server settings
$host = "smtp.world4you.com";
$port = "587";
$username = "office@flughafen-taxi.net";
$password = "habe ich schon ";


$messageBody = "";

if($_POST['name']!='false'){
$messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['name']!='false'){
$messageBody .= '<p>Country: ' . $_POST["country"] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['email']!='false'){
$messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}else{
$headers = '';
}
if($_POST['state']!='false'){
$messageBody .= '<p>State: ' . $_POST['state'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['phone']!='false'){
$messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['fax']!='false'){
$messageBody .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['message']!='false'){
$messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";
}

if($_POST["stripHTML"] == 'true'){
$messageBody = strip_tags($messageBody);
}

if($host=="" or $username=="" or $password==""){
$owner_email = $_POST["owner_email"];
$headers = 'From:' . $_POST["email"] . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n";
$subject = 'A message from your site visitor ' . $_POST["name"];

try{
if(!mail($owner_email, $subject, $messageBody, $headers)){
throw new Exception('mail failed');
}else{
echo 'mail sent';
}
}catch(Exception $e){
echo $e->getMessage() ."\n";
}
}else{
require_once 'Mail.php';

$to = $_POST["owner_email"];
$subject = 'A message from your site visitor ' . $_POST["name"];
$headers = array (
'From' => 'From:' . $_POST["email"] . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n",
'To' => $to,
'Subject' => $subject);

$smtp = Mail::factory(
'smtp',
array (
'host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));

$mail = $smtp->send($to, $headers, $messageBody);

try{
if(PEAR::isError($mail)){
echo $mail->getMessage();
}else{
echo 'mail sent';
}
}catch(Exception $mail){
echo $mail->getMessage() ."\n";
}
}



?? kann mit jemand helfe
?>



hier der andere formular zum online buchen


<?php
$ownerEmail = $_POST["owner_email"];
$headers = 'From:' . $_POST["sender"] . 'Content-Type: '. $_POST["sender"] .'; charset=UTF-8' . "\r\n";
$subject = 'An order from your site visitor';
$messageBody = "";

$arr=array();
$arr=$_POST;
foreach ($arr as $key => $value) {
echo "$key".': '."$value".'&';
if (($value != 'nope') && ($key != 'owner_email') && ($key != 'sender')) {
$messageBody .="$key" . ': '."$value" . "\n\n";
}
}

try{
echo $_POST['Email'];
echo $subject;
echo $messageBody;

if(!mail($ownerEmail, $subject, $messageBody, $headers)){
throw new Exception('mail failed');
}else{
echo 'mail sent';
}
}catch(Exception $e){
echo $e->getMessage() ."\n";
}
?>



www.flughafen-taxi.at
Avatar użytkownika

novica

  • Posty: 2
  • Dołączył(a): Pn lis 28, 2016 5:08 pm


+ Odpowiedz

Strona 1 z 1