note 118991 added to function.mail

From: Date: Sun, 13 Mar 2016 15:42:26 +0000
Subject: note 118991 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-205152@lists.php.net to get a copy of this message
I was working with this here to send my email with PHP, but for some reason it stopped working. May someone of you have an idea what is wrong. <?php error_reporting(E_ALL ^ E_NOTICE); if(isset($_POST['submitted'])) { if(trim($_POST['contactName']) === '') { $nameError = 'Sie haben ihren Namen vergessen.'; $hasError = true; } else { $name = trim($_POST['contactName']); } if(trim($_POST['betreff']) === '') { $betrError = 'Sie haben ihr Betreff - Anliegen vergessen.'; $hasError = true; } else { $betreff = trim($_POST['betreff']); } $telefon = trim($_POST['telefon']); $company = trim($_POST['company']); if(trim($_POST['email']) === '') { $emailError = 'Sie haben ihre Email Adresse vergessen.'; $hasError = true; } else if (!preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i", trim($_POST['email']))) { $emailError = 'Sie haben ihre Email Adresse falsch eingegeben.'; $hasError = true; } else { $email = trim($_POST['email']); } if(trim($_POST['comments']) === '') { $commentError = 'Sie haben ihre Nachricht vergessen.'; $hasError = true; } else { if(function_exists('stripslashes')) { $comments = utf8_encode(stripslashes(trim($_POST['comments']))); } else { $comments = trim($_POST['comments']); } } if(!isset($hasError)) { $emailTo = 'example@example.com'; $subject = 'Kobsche.de - '.$name.' - '.$betreff; $sendCopy = trim($_POST['sendCopy']); $body = "\n\nDies ist eine Email von ihrem Kontakt Formular auf der Webseite http://www.example.com/\nAlle uebermittelten Daten des Benutzers durch das Formular finden sie unterhalb dieses Textes.\n\nFirma - Unternehmen : $company\n\nName - Ansprechpartner : $name \n\nEmail-Adresse : $email \n\nTelefon-Nr. : $telefon \n\nBetreff - Anliegen : $betreff\n\nNachricht des Nutzers: $comments\n\n"; $headers = "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"; mail($emailTo, $subject, $body, $headers); $emailSent = true; } } ?> ---- Server IP: 72.52.91.14 Probable Submitter: 2003:7a:ee62:f5ba:3454:ac35:8bc5:88f2 ---- Manual Page -- http://php.net/manual/en/function.mail.php Edit -- https://master.php.net/note/edit/118991 Del: integrated -- https://master.php.net/note/delete/118991/integrated Del: useless -- https://master.php.net/note/delete/118991/useless Del: bad code -- https://master.php.net/note/delete/118991/bad+code Del: spam -- https://master.php.net/note/delete/118991/spam Del: non-english -- https://master.php.net/note/delete/118991/non-english Del: in docs -- https://master.php.net/note/delete/118991/in+docs Del: other reasons-- https://master.php.net/note/delete/118991 Reject -- https://master.php.net/note/reject/118991 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#205152) next »