Retrieve data from cart and send using mail

后端 未结 2 1762
醉酒成梦
醉酒成梦 2021-01-27 12:10

This project is with E-Commerce. There is option to Add to Cart. When user click on add, product will be added to his cart as well and working fine.

2条回答
  •  醉话见心
    2021-01-27 12:42

    use jquery and capture the html table that you want to send as email. and pass the variable to the email function using ajax, try this,

        
    

    jquery veriable = htmlstring

    also you can use jquery serialize method to get all form inputs.

    https://api.jquery.com/serialize/

    CI ocontroller

    public function testmail(){
    
                $to = 'mail@gmail.com';
                $subject = 'Enquiry from ';
                $message = $_POST['table'];
                $headers = "MIME-Version: 1.0\r\n";
                $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    
                if(mail($to, $subject, $message, $headers))
                {
    
                }
            }
    

提交回复
热议问题