473,394 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Having a problem with email submission form?

I was wondering if anyone could be of assistance, I'm having problems setting up the email us section of my webpage... this is the code I am using. When the details are completed on the form and is submitted it says 'email sent' but it is not received?

Any tips, or pointing out what I've done wrong, would be gratefully received.


Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. include 'functions.php';
  4.  
  5. if (!empty($_POST)){
  6.  
  7.   $data['success'] = true;
  8.   $_POST  = multiDimensionalArrayMap('cleanEvilTags', $_POST);
  9.   $_POST  = multiDimensionalArrayMap('cleanData', $_POST);
  10.  
  11.   //your email address 
  12.   $emailTo ="info@thevaultkr.com"; //"info@thevaultkr.com";
  13.  
  14.   //from email address
  15.   $emailFrom ="info@thevaultkr.com"; //"info@thevaultkr.com";
  16.  
  17.   //email subject
  18.   $emailSubject = "Mail from The Vault";
  19.  
  20.   $name = $_POST["name"];
  21.   $email = $_POST["email"];
  22.   $comment = $_POST["comment"];
  23.   if($name == "")
  24.    $data['success'] = false;
  25.  
  26.  if (!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $email)) 
  27.    $data['success'] = false;
  28.  
  29.  
  30.  if($comment == "")
  31.    $data['success'] = false;
  32.  
  33.  if($data['success'] == true){
  34.  
  35.   $message = "NAME: $name<br>
  36.   EMAIL: $email<br>
  37.   COMMENT: $comment";
  38.  
  39.  
  40.   $headers = "MIME-Version: 1.0" . "\r\n"; 
  41.   $headers .= "Content-type:text/html; charset=utf-8" . "\r\n"; 
  42.   $headers .= "From: <$emailFrom>" . "\r\n";
  43.   mail($emailTo, $emailSubject, $message, $headers);
  44.  
  45.   $data['success'] = true;
  46.   echo json_encode($data);
  47. }
  48. }
Feb 14 '15 #1
0 1027

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Akinia | last post by:
Hi every body I've got a little problem with my form ("frm_Company"). It is divided in two parts: - first one is filled with some text fields over the company. - second one is filled with a tab...
6
by: jstaggs39 | last post by:
I want to create a Dcount and an If...Then...Else statement to count the number of records in a table based on the date that is entered to run the form. The If....Else statment comes in because if...
3
by: Jarek Mielcarek | last post by:
hi, I've problem to locate form on screen. I'd like to show modal form near a textbox after user click on it. here is the code: Private Sub myTextBox_MouseDown(ByVal sender As Object, ByVal e As...
0
by: just.starting | last post by:
I am having problem while downloading files from an apache server2.0.53 with php4.3.10.While downloading some files it generally stops after downloading some specific amount and then stops...
2
by: TanBrae | last post by:
Hi all. I found this forum while searching for an answer to an error message I am getting from my submission form on my website. I hope somebody will be able to help me with this. A bit of...
2
by: Dave | last post by:
I have a form on my ASP 3.0 web site and I need to monitor submissions. Is it possible to generate an email upon form submission? If so, how do I invoke the email functionality from an ASP 3.0...
1
by: Tyecom | last post by:
I'm having a problem getting the form I want to start first, to start first. I went to my program's property window and select which form I want to start first, but no matter which form I chose, it...
1
by: craigathurst | last post by:
Hi guys, I'm new to the whole visual web developer thing and i'm trying to do the following.... I'm using ASP.NET and i want to create a submission form that inserts the DATA submitted into...
1
by: smartic | last post by:
Having problem with some characters like ( # , + , &) in my PHP page i can't see these characters in my database how can isolve this problem ?
12
by: DeZZar | last post by:
Hi all, I'll explain my database first. Users input customer details that are required to complete a company document. The document merge etc is all working - the database saves the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.