PDOCrud Send email using PDOCrud

PDOCrud allows send form fields values added by user, to the email directly. You can formSendEmail function to define various email parameters. You can define message template or use the default template. Default template option allows you to send email with all fields in table format. You can define template for subject also. You can put filed name inside two curly braces. You can also insert and send email both by setting 5th parameter true.

  
                                $pdocrud = new PDOCrud();
                                $pdocrud->formFields(array("first_name","last_name","email","message"));
                                $subject = "Email from {{first_name}} {{last_name}}";
                                $message = "default_template";// this will display all fields in table format in email
                                //You can also define message new template as below
                                //$message = "first_name:{{first_name}}
last_name:{{last_name}}
message:{{message}}
"; $pdocrud->formSendEmail("info@pdocrud.com",array("someemail@gmail.com"),$subject,$message); echo $pdocrud->setLangData("save", "Sign me up!")->dbTable("contact")->render("emailform");