/    Sign up×
Community /Pin to ProfileBookmark

Contact Form what i Can Do More

Hello Guys,
I Made Contact Form & When I Submit i Feel It Work But It Gives Me a Black Page and Didn’t Send Me The Mail With Data.
Can Any One Help Me & Tell Me What I Need More Or What I Missed , It Will SO Grateful.
Here Is PHP Code:

[code]

if (isset($_POST[‘Submit’])) {
$FirstName = $_POST [‘FormFirstName’];
$SecondName = $_POST [‘FormSecondName’];
$Mail = $_POST [‘FormEMail’];
$Mobile = $_POST [‘FormMobile’];
$Message = $_POST [‘FormYourComment’];
$recipient = “[email protected]” ;
$subject = “Contact Form”;
$mailheader = “From: $Mail rn”;
mail($recipient, $subject, $Message, $mailheader) or die(“Error!”);
echo “Thank You!”; }

[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 01.2016 — While there is plenty of room there for error-checking and such, I suspect your immediate problem is trying to send mail through your server's mail system with a From address that is not a valid address on that server. If so, then the "From:" message header needs to be [i]your[/i] email address on that server, to which you can then append a "Reply-To:" header that uses the submitted email address.
Copy linkTweet thisAlerts:
@calevansSep 14.2016 — Are you sure you have a MTA (mail server) running on your web server. (many web servers don't these days) If you don't, you can use something like MailGun.com from Rackspace. (free for the first 10,000 messages each month) You will have to do some comfiguration to get PHP to use it with the mail() command, or you can simply use their REST API to send the message. (curl or Guzzle)

PLEASE use filter_var() on all your $_POST variables before you use them. It is very insecure to use raw data form your user. (Users are bastards.) ?

HTH,

=C=
Copy linkTweet thisAlerts:
@ginerjmSep 14.2016 — Is there a reason you write your English in camelCase like it is JS code? Some people here have difficulty writing English with ANY caps or punctuation. You have taken it to the next level! ?
×

Success!

Help @AhmadMWaddah spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...