473,399 Members | 3,302 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,399 software developers and data experts.

How can I send mail using mail function through post method. I don't know where i did

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.       if(isset($_POST['order']))
  3.       {
  4.          require_once("connection.php");
  5.         $query= "insert into order1 (`total`,`quantity`,`firstname`,`date_createdAt`,`email`,`address`,`city`,`state`,`telephone`,`mobile2`,`comments`) values ('".$total."','".$quantity."','".$_POST['firstname']."','".date("Y-m-d h:i:s")."','".$_POST['email']."','".$_POST['address']."','".$_POST['city']."','".$_POST['state']."','".$_POST['telephone']."','".$_POST['telephone2']."','".$_POST['Comments']."')";
  6.         $result =  mysqli_query($con, $query) or die(mysqli_error($con));
  7.         $max_query = mysqli_query($con, "SELECT  max(id) FROM order1 ") or die(mysqli_error($con));
  8.         $max_row = mysqli_fetch_array($max_query);
  9.  
  10.  
  11.  if($cart){
  12.         foreach($cart as $k=>$v)
  13.         {
  14.              mysqli_query($con, "insert into product_order (`product_id`,`order_id`) values ('".$v->id."','".$max_row[0]."')") or die(mysqli_error($con));
  15.         }
  16.  }
  17.  
  18.  
  19.  
  20.  
  21.     unset($_SESSION['cart']);
  22.     unset($_SESSION['count']);
  23.  
  24. $to=$_POST['email'];
  25. $subject = 'Order';
  26. $message = 'your order has been received';
  27. $headers = 'From:info@booksjerry.com' . "\r\n" .
  28.     'Reply-To: info@booksjerry.com' . "\r\n" .
  29.     'X-Mailer: PHP/' . phpversion();
  30.  
  31. if(mail($to, $subject, $message, $headers)){
  32.  echo"Mail Successfully Sent";
  33.  
  34.        }
  35.        else{
  36.             echo"Mail Could not be Sent";
  37.        }
  38.       ?>
Apr 8 '20 #1
0 1705

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

Similar topics

4
by: engrkhalid | last post by:
Hello everybody, When I send an email to any Hotmail account it goes directory to the Junk Email! My website is in a dedicated server using: Linux 2.4.21, Apa­che, PHP, MySQL I'm using the...
3
by: vishal | last post by:
i am getting following error. Warning: mail() : Failed to connect to mailserver at "smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in...
1
by: Edward | last post by:
My computer is at intranet,I want to use following code to realizing function of sending mail.But this program only can send mail between intranet.If I send mail in internet,I need to through proxy...
0
by: Henrik Bergman | last post by:
Hi all As I subscribe MSDN I got an USB-memory with Microsoft eLearing library. I found an exampell how to send SMTP e-mail using CDO.Message object and CDO.Configuration. But when I try to...
1
by: Dean | last post by:
I am using MailMessage (CDOSYS) to send emails. I would like to turn off the SMTP service (it's on the local machine) and look at the emails in the pickup folder before they get sent out. However,...
0
by: Ricardo Magalhaes | last post by:
Hi, I have an ASPX page and I need to call an ASP page sending parameters like Name, Adress, ie. using POST method. This next ASP page show payment informations.. If was from an ASP to...
0
by: Elankathir S.N. | last post by:
Hi All, I’m using ASP with VBScript…and I need to send mails using Lotus Notes Mail Server (IBM). How to communicate to the Lotus Notes Server and send mails??? Thanks, - Elan
2
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console...
2
by: Max | last post by:
hi I am using System.Web.Mail.MailMessage with System.Web.Mail.SmtpMail to send mail. now the my question is, Is it compulsory to add fields smtpauthenticate, sendusername and sendpassword...
1
by: swetha123 | last post by:
hello, can any tell me how to send mails from site using mail() in php do we need to change in the php.ini these are in php.ini
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.