April 20, 201016 yr Can someone help with this code, I try to do mail form but it does not work <?php function send_employee(){ ob_start(); $mailto = 'email@url.com'; $subject="Contact ".$_POST['lastname']." ".$_POST['firstname']; $strTo = $mailto; $strSubject = $subject; $strMessage = "Recruit with HF ::".$_POST['lastname']." ".$_POST['firstname']." Last name: ".$_POST['lastname']." First name: ".$_POST['firstname']." Email: ".$_POST['email']." Home Phone Number: ".$_POST['telephone']." Mobile: ".$_POST['mobile']." Enquiry: ".$_POST['enquiry']." Address: ".$_POST['address']." City: ".$_POST['city']." Location: ".$_POST['location']; $m = new Mail(); // create the mail $m->From($email_from); $m->To($mailto); $m->Subject($subject); $m->Body($strMessage,"utf-8"); //$m->Attach($strFileName, "text/html", "inline" ); if($_FILES['browseandattachfile']['name']!=''){ $m->Attach($_FILES['browseandattachfile']['tmp_name'],$_FILES['browseandattachfile']['type'], "attachment" ); } $m->Send(); // send the mail echo "<script language='JavaScript'>alert('Thank you for contacting HR');window.location= 'contact-us.html';</script>";die; //echo $m->Get(); // show the mail source //ob_clean(); //ob_end_clean(); }
April 23, 201016 yr I'm having a similar problem and have posted a new topic - Email form results and redirect... Were you able to solve your problem?
Create an account or sign in to comment