PHP - Php Email Code
The attached code works except the email portion. This code allows a user to upload a file(s) to a network share & has a few check mark boxs for John Doe & Jane Doe. If the box for John or Jane is checked it is suppose to send them an email once submit is pressed but the email does not get sent. Can someone help me out on this? Thanks
Similar TutorialsI use this type of a code to send automatic emails from my website: Code: [Select] $headers = ; $headers .= ; $to = ; Click here to go to Google. ", $headers); I am having hard time figuring out how to do hyperlink on words (like here). If I do something like this: Code: [Select] <a href='http://www.google.com'>here</a> it spits out that exact thing out. Thanks you for your input Help with PHP Email Code I am currently designing a PHP website and i have been following some useful tutorials but one that i have followed i have come unstuck with and it wont work. If anyone could help me with the code below it would be a great help. First of all we have the contact.html form Code: [Select] <html> <head> <title>Ajax Contact Form by Andrew Walsh</title> <style type="text/css"> body { margin:50px 0px; padding:0px; text-align:center; } #contactarea { width:350px; margin:0px auto; text-align:left; padding:15px; border:1px solid #333; background-color:#eee; font-weight: bold; font-family: Verdana, Arial; font-size: 12px; } #inputbox { border: 1px solid #000; width: 270; padding: 2px; font-weight: bold; font-family: Verdana, Arial; font-size: 12px; } #inputlabel { font-weight: bold; font-family: Verdana, Arial; font-size: 12px; } #textarea { border: 1px solid #000; padding: 2px; font-weight: bold; font-family: Verdana, Arial; font-size: 12px; width:330; } #submitbutton { border: 1px solid #000; background-color: #eee; } </style> <script language="javascript"> function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sendemail() { var msg = document.contactform.msg.value; var name = document.contactform.name.value; var email = document.contactform.email.value; var subject = document.contactform.subject.value; document.contactform.send.disabled=true; document.contactform.send.value='Sending....'; http.open('get', 'contact.php?msg='+msg+'&name='+name+'&subject='+subject+'&email='+email+'&action=send'); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4){ var response = http.responseText; var update = new Array(); if(response.indexOf('|' != -1)) { update = response.split('|'); document.getElementById(update[0]).innerHTML = update[1]; } } } </script> </head> <body> <div id="contactarea"> <form name="contactform" id="contactform"> <span id="inputlabel">Name:</span> <input type="text" name="name" id="inputbox"> <span id="inputlabel">Email:</span> <input type="text" name="email" id="inputbox"> <span id="inputlabel">Subject:</span> <input type="text" name="subject" id="inputbox"> <span id="inputlabel">Message:</span> <textarea name="msg" rows="10" id="textarea"></textarea> <input type="button" value="Send Email" name="send" onclick="sendemail();" id="submitbutton"> </form> </div> </body> </html> Then we have the contact.php form <?php /* Author: Andrew Walsh Date: 30/05/2006 Codewalkers_Username: Andrew This script is a basic contact form which uses AJAX to pass the information to php, thus making the page appear to work without any refreshing or page loading time. */ $to = "mike2fast135@hotmail.com"; //This is the email address you want to send the email to $subject_prefix = ""; //Use this if you want to have a prefix before the subject if(!isset($_GET['action'])) { die("You must not access this page directly!"); //Just to stop people from visiting contact.php normally } /* Now lets trim up the input before sending it */ $name = trim($_GET['name']); //The senders name $email = trim($_GET['email']); //The senders email address $subject = trim($_GET['subject']); //The senders subject $message = trim($_GET['msg']); //The senders message mail($to,$subject,$message,"From: ".$email.""); //a very simple send echo 'contactarea|Thank you '.$name.', your email has been sent.'; //now lets update the "contactarea" div on the contact.html page. The contactarea| tell's the javascript which div to update. ?> From what i can gather the HTML form passes the information to the PHP form which then sends the information to your email address. I have changed the email address to the one that i want to use and have also tried using a different one incase it did not like the one i have chosen to use. If anyone could help with this i would really appreciate it. Thanks Posts: 1 Joined: Thu Mar 31, 2011 12:03 pm Top HI everyone, I am sure this has got to be common question. Is there a way to tell if an email recipient opened an email I sent? Here is the scenario. In an application where the application sends email campaigns. So, if I send out an email to 100 people, I want to keep track of how many of them actually opened the email. I do not want to rely on a reader clicking a link, or downloading image to determine if the "read" the email, as one can still read an email without doing those things. Is there a more reliable way? Thanks Kipper Hi guys, I have a booking form on my website for potential customers to request a booking. The form asks for their Name, Address, Email and Tel No. I need the code to be able to send the form by Php. I also need it to show an error message if they haven't completed any of the fields. The fields on my form a Name, Address, District, City, Postcode, Tel No, Email. Please help. i have a page in my website with PHP , that do a customer comment and it send me an emails for those comments , and then send an automatic email to the customer , but my only problem is that i want the customer to receive the email as it is from the email i got my emails on , but when the customer received the email it received as my username in my host site @ hostsite.com i want to solve this please thanks. here is the code : <?php require_once('recaptchalib.php'); $errFlag=0; $showForm=1; //KEEP YOUR PRIVATE KEY HERE $privatekey = ""; // << replace this key with yours function isValidEmail($email){ return filter_var(filter_var($email, FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL); } if (isset($_POST["submit"])){ $name=$_POST['name']; $lname=$_POST['lname']; $phone=$_POST['phone']; $email=$_POST['email']; $message=$_POST['message']; if(empty($_POST)) { $errMsg[]="Please enter all the field."; } if(empty($name)) { $errMsg[]="Please enter your First Name."; } if(empty($lname)) { $errMsg[]="Please enter your Last Name."; } if(empty($phone)) { $errMsg[]="Please enter phone number."; } elseif(!is_numeric($phone)) { $errMsg[]="Please enter valid phone number."; } if(empty($email)) { $errMsg[]="Please enter an email address."; } elseif(!isValidEmail($email)) { $errMsg[]="Please enter an valid email address."; } if(empty($message)) { $errMsg[]="Please enter message."; } /* captcha validation */ $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly $errMsg[]="The CAPTCHA wasn't entered correctly. Please try it again."; } if(empty($errMsg)) { // if there is no error then send a mail $ToEmail = 'myreiki11@gmail.com'; // CHANGE YOUR EMAIL WHERE YOU WANT TO RECEIVE THE CONTACT FORM SUBMITTED BY USERS... $EmailSubject = 'Customer Comments '; $mailheader = "From: ".$email."\r\n"; $mailheader .= "Reply-To: ".$email."\r\n"; $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; $MESSAGE_BODY = "Name: ".$name." ".$lname."<br>"; $MESSAGE_BODY .= "Phone: ".$phone."<br>"; $MESSAGE_BODY .= "Email: ".$email."<br>"; $MESSAGE_BODY .= "Comment: ".nl2br($message)."<br>"; mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); if(mail) { $msg="Thank your for submitting the form, we will contact your shortly."; $showForm=0; mail($email, "Thank your for submitting.", $msg); } else { $msg="Some errors occured, please try again in a while."; } } else { $errFlag=1; } } ?> <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns="urn:schemas-microsoft-comfficeffice" xmlns="http://www.w3.org/TR/REC-html40"> <head> <link rel="shortcut icon" href="http://www.divineenergyhealing.co/favicon.ico"> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Customer Comments</title> <meta name="description" content="Customer Comments"> <link rel="File-List" href="reiki website/Reiki/Customer Comments_files/filelist.xml"> <base target="_self"> <!--[if !mso]> <style> v\:* { behavior: url(#default#VML) } o\:* { behavior: url(#default#VML) } .shape { behavior: url(#default#VML) } </style> <![endif]--><!--[if gte mso 9]> <xml><o:shapedefaults v:ext="edit" spidmax="1027"/> </xml><![endif]--> <style type="text/css"> /* error and success msg */ #errMsg { background-color:#febbbb; border:1px solid #d31a1c; color:#d31a1c; font-size:12px; padding:10px; margin-bottom:15px;} #successMsg { background-color:#ffffff; border:1px solid #ffffff; color:#000000; font-size:16px; padding:10px; margin-bottom:15px; margin-top:25px;} #contact_form { position: absolute; width: 888px; height: 365px; z-index: 1; left: 190px; top: 128px;} #contact_form form label { display:block;} contact_form p { margin-bottom:10px;} .auto-style1 { font-family: "Times New Roman", Times, serif; font-weight: bold; color: #FFFFFF; } </style> </head> <body link="#0000FF" vlink="#800000" alink="#FF0000"> <p> </p> <p align="left"> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p align="left"> </p> <div id="contact_form" style="left: 192px; top: 102px"> <?php if($errFlag) { echo "<div id='errMsg'>"; foreach($errMsg as $val) { echo "- "; echo $val; echo "<br />"; } echo "</div>"; } ?> <?php if($showForm){ ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" name="contact_form" method="post"> <p> <label for="name">First Name</label> <input name="name" type="text" id="name" value="<?php if (isset($_POST['name'])) echo $_POST['name']; ?>" /> </p> <p style="height: 45px"> <label for="lname">Last Name</label><input name="lname" type="text" id="lname" style="width: 148px; height: 22px" value="<?php if (isset($_POST['lname'])) echo $_POST['lname']; ?>" /> </p> <p> <label for="phone">Phone Number</label> <input name="phone" type="text" id="phone" value="<?php if (isset($_POST['phone'])) echo $_POST['phone']; ?>" /> </p> <p> <label for="email">Email Address</label> <input name="email" type="text" id="email" value="<?php if (isset($_POST['email'])) echo $_POST['email']; ?>" /> </p> <p> <label for="message">Customer Comments</label> <textarea name="message" id="message" style="width: 247px; height: 84px" rows="999"><?php if (isset($_POST['message'])) echo $_POST['message']; ?></textarea> </p> <p> <?php //PUT YOUR PUBLIC KEY HERE $publickey = ""; // << replace this key echo recaptcha_get_html($publickey); ?> </p> <p><input name="submit" type="submit" value="Submit" /> <input name="reset" type="reset" value="Reset" /></p> </form> <?php } else { ?> <div id="successMsg" class="auto-style1">Thanks for your comments and questions we appreciate that you took the time to send us..</div> <?php }?> </div> </body> </html> Hi, I have this email code working for me: $headers1 = "From: my@email.com\r\n"; $headers1 .= "BCC: other@email.com\r\n"; $to1 = $_GET['e1'].", ". $_GET['e2'].", ". $_GET['e3'].", ". $_GET['e4']; mail($to1, " my subject line", " my message here ", $headers1); In the forms users can submit up to 4 independent email addresses (but are not required to do so) in any combination. This email from works only if email address 1 and 4 are entered. Other can be entered too, but if 1 and 4 are not there email does not go out. I sort of understand why, but I can not figure out a way around it and I do not want to split to 4 independent email codes. Any help on this one? Thanks i wanting users to be able to update there email address and check to see if the new email already exists. if the email is the same as current email ignore the check. i have no errors showing up but if I enter a email already in the db it still accepts the new email instead of bringing the back the error message. Code: [Select] // email enterd from form // $email=$_POST['email']; $queryuser=mysql_query("SELECT * FROM members WHERE inv='$ivn' ") or die (mysql_error()); while($info = mysql_fetch_array( $queryuser )) { $check=$info['email']; // gets current email // } if($check!=$email){ // if check not equal to $email check the new email address already exists// $queryuser=mysql_query("SELECT * FROM members WHERE email='$email' "); //$result=mysql_query($sql); $checkuser=mysql_num_rows($queryuser); if($checkuser != 0) { $error= "0"; header('LOCATION:../pages/myprofile.php?id='.$error.''); } } cheers The attached code works perfect for me. This code displays data from my mysql database in a browser & allows me to edit it, then re-submit it to the mysql database. Again, all of this works great. I was wondering if there was a way way for me to add some code to this existing code that would send me an email with the information in the form when the submit button is clicked? Nothing fancy....I'd just like to get an email based off of the location, for example if the location is changed from "Office1" to "Office2", I'd like the email to go to office2@mail.com. If "Office3" is entered, I'd like the form info to go to office3@mail.com. Is this possible? Hi everyone.
Pretty desperate, first time that I'm working with php. Learning this language, makes sense, however I can't figure out why my code is not working.
Emails are not coming in at all. Additional required info (phone number, first name, last name) should be included in the message.
Please help. Thank you everyone.
<?php $to = "abcd@abcd.com"; $subject = "From Website Contact Form"; $first = $_REQUEST['first']; $last = $_REQUEST['last']; $email = $_REQUEST['email']; $phone = $_REQUEST['phone']; $MESSAGE_BODY = "Name: " . $_POST["first"] . "\n"; $MESSAGE_BODY = "Name: " . $_POST["last"] . "\n"; $MESSAGE_BODY = "Contact No: " . $_POST["phone"] . "\n"; $MESSAGE_BODY = "Email: " . $_POST["email"] . "\n"; $MESSAGE_BODY = "Requirement: " . nl2br($_POST["message"]) . "\n"; $message = $_REQUEST['message' + 'email' + 'first' + 'last']; $from = $_REQUEST['email']; $headers = "From:" . $from; mail($to, $subject, $MESSAGE_BODY, $headers); echo "Your message has been sent"; ?> Ok so I followed Buddski's advice to use MIME for the attatchment. (thanks for the help by the way, definitely headed in the right direction now.... i think...) The image now successfully uploads to temp_folder on submit, the email is then delivered with correct text variables (name, phone, address etc.). However, instead of their being an image included - there is just raw code. If anyone could help with the final fix you may just save my sanity! Thanks. Code: [Select] <?php ini_set("sendmail_from", "darren@mywebsite.co.uk"); ini_set("SMTP", "smtp.myhosts.co.uk"); // Subject and Email Destinations // $emailSubject = 'Work Email!'; $webMaster = 'darren@mywebsite.co.uk'; // Gathering Data Variables // $name = trim($_POST['name']); // create a unique boundary string // $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; // Add the headers for a file attachment // $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; // Add a multipart boundary above the plain message // $message ="This is a multi-part message in MIME format.\n\n"; $message.="--{$mime_boundary}\n"; $message.="Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $message.="Content-Transfer-Encoding: 7bit\n\n"; $message.= "Name: ".$name."\n"; //The file type of the attachment // $file_type = 'text/csv'; // The place the files will be uploaded to (currently a 'files' directory) // $upload_path = './uploads/'; // Get the name of the file (including file extension) // $filename = $_FILES['userfile']['name']; // Get the extension from the filename // $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Configuration of File Uploaded // $allowed_filetypes = array('.jpg','.JPEG','.jpeg','.gif','.bmp','.png'); $max_filesize = 2000000; (move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename)); //This attatches the image file to the email // $message .= chunk_split(base64_encode(file_get_contents($upload_path . $filename))); // Send the Email with the attatchment. $success = mail($webMaster, $emailSubject, $message, $headers, "-fdarren@dsinteriorsltd.co.uk"); ?> >>>is returning this to my email... Code: [Select] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="==Multipart_Boundary_x9cbb390d8be528476c5423025ed1e4ccx" This is a multi-part message in MIME format. --==Multipart_Boundary_x9cbb390d8be528476c5423025ed1e4ccx Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Name: darren /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEB........................................................... ..........this code goes on like this for ages. Hi FYI I'm a n00b in this particular forum & php n00b really but I'm having a problem & cant find a solution anywhere! I need to be able to send an email from a form. Within the form is a dropdown field for different regions. When a region is selected it sets the email address for that region into an input/text field. I need to pickup that value and send the email to that address but not sure how. Have been told to use echo$email & that perhaps my variable is empty but I haven't got a clue where to put it or what that means. Help please?! my code: include ('maketable.php'); include ('mailbot.php'); include ('auditFile.php'); $office = $_REQUEST["office"]; $callername = $_REQUEST["callername"]; $callerphone = $_REQUEST["callerphone"]; $callaction = $_REQUEST["callaction"]; $callerInfo = "Callers Name=".$callername; $commentInfo = "Callers Phone No=".$callerphone; $callDetail = "Action Taken=".$callaction; $title = "DOC Call Results"; $stylesheet = "stylesheet.css"; $logo = "tcclogo.jpg"; $display = makeHeader($title,$stylesheet,$logo); $display .= makeTable("Caller Details",$callerInfo,1); $display .= makeTable("",$commentInfo,1); $display .= makeTable("",$callDetail,1); $display .= '</body></html>'; $info = $callerInfo."; ".$commentInfo."; ".$callDetail; auditFile($title, $info); echo $email; mailbot($title,$display,"email","info@tcc.co.nz","ThankYou.html"); $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_port' => '465', 'smtp_user' => 'removed@removed.nothing', 'smtp_pass' => 'removed' ); but I can't send that email... It show error like this... A PHP Error was encountered Severity: Warning Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) Filename: libraries/Email.php Line Number: 1673 A PHP Error was encountered Severity: Warning Message: fwrite(): supplied argument is not a valid stream resource Filename: libraries/Email.php Line Number: 1816 I have a form on a page which is accessed when a user logs into their account. The form dynamically pulls bits of the users info from 2 tables in a mysql database, Tables (ITEMS) and Table (USERS). Table (USERS) holds the users info (NAME, EMAIL ETC) while Table (ITEMS) hold information about the users items for which they may have several of. When the form page is accessed all the users items from Table (ITEMS) are dynamically shown on the form with several radio buttons at the side of each item. The user can tick certain radio buttonss at the side of each item and click the send button. TRYING TO ACHIEVE... After the form is sent a thank you message is returned on the same page with details of the items and what radios were ticked. An Email of the same is sent to user with info of the items and what radios were ticked. An Email is also sent to me with same info of the items and what radios were ticked. WHAT I AM ACHIEVING SO FAR WITH CODE BELOW: The form page is ok showing all users items, radios, send button etc. The returned thank you page is fine showing items, what radios were checked etc. Even the email part is working sending an email to the user and myself. THE PROBLEM IS THAT A SEPERATE EMAIL IS SENT TO BOTH OF US FOR EACH ITEM THE USER HAS IN THE DATABASE. I JUST WANT ONE EMAIL SENDING TO BOTH OF US DETAILING ALL ITEMS. I realise this is because of the while statement in the call to the database which is looping the below code for each item thus sending an email for each item. What I can not suss out is how to send just the one email with all items on. Tried moving the closing loop bracket all over the place and parts of the code but to not avail. THE CODE: (some unecessary code removed from echo/thank you to simplify) <table width="100%"> <tr> <td class="bodytext"><strong>Name</strong></td> <td class="bodytext"><strong>Ref</strong></td> <td><strong>Status</strong></td> <td><strong>Type</strong></td> <td><strong>Date</strong></td> <td><strong>Extend</strong></td> <td><strong>Feature</strong></td> <td><strong>Offer</strong></td> </tr> <form action="example-this-page" method="post"> <input type="hidden" name="action" value="0"> <input type="hidden" name="id" value="<?php echo $_REQUEST["id"]; ?>"> <?php $sql = "SELECT * FROM ".$TABLES["items"]." WHERE user_id='".$_SESSION["UserAccount"]."'"; $sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql); while ($ITEMS = mysql_fetch_assoc($sql_result)) { $sql = "SELECT * FROM ".$TABLES["users"]." WHERE id='".$ITEMS["user_id"]."'"; $sql_resultT = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql); $USER=mysql_fetch_assoc($sql_resultT); ?> <? if (isset($action)) { $to = $USER["email"]; $mailheader = "From: $email\r\n"; $mailheader .= "Reply-To: $email\r\n"; $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; $msg = "Dear ".stripslashes($USER["name"])."<br><br> <table><tr> <td><strong>Name</strong></td> <td><strong>Ref No</strong></td> <td><strong>Status</strong></td> <td><strong>Type</strong></td> <td><strong>Date</strong></td> <td><strong>Extend</strong></td> <td><strong>Feature</strong></td> <td><strong>Offer</strong></td> </tr> <tr> <td>".stripslashes($ITEMS["name"])."</td> <td>".stripslashes($ITEMS["ref"])."</td> <td>".stripslashes($ITEMS["status"])."</td> <td>".stripslashes($ITEMS["type"])."</td> <td>".stripslashes($ITEMS["date"])."</td> <td>".$_POST['extend']."</td> <td>".$_POST['feature']."</td> <td>".$_POST['offer']."</td> </tr> </table> "; mail($to, "subject", $msg, $mailheader) or die ("Failure"); mail("me@me.co.uk", "subject", $msg, $mailheader) or die ("Failure"); echo "<br /><br /><font size=2> <strong><center>Thank you!</center><br /> Your details of your request has been sent:</center><br /> "; }; ?> <tr> <td><?php echo stripslashes($ITEMS["name"]); ?></td> <td><?php echo stripslashes($ITEMS["ref"]); ?></td> <td><?php echo stripslashes($ITEMS["status"]); ?></td> <td><?php echo stripslashes($ITEMS["type"]); ?></td> <td><?php echo stripslashes($ITEMS["date"]); ?></td> <td><input type="radio" name="extend<?php echo stripslashes($ITEMS["id"]); ?>" value="No"> No <input type="radio" name="extend<?php echo stripslashes($ITEMS["id"]); ?>" value="Yes" /> Yes</td> <td><input type="radio" name="featured<?php echo stripslashes($ITEMS["id"]); ?>" value="No"> No <input type="radio" name="featured<?php echo stripslashes($ITEMS["id"]); ?>" value="Yes" /> Yes</td> <td><input type="radio" name="latedeal<?php echo stripslashes($ITEMS["id"]); ?>" value="No"> No <input type="radio" name="latedeal<?php echo stripslashes($ITEMS["id"]); ?>" value="Yes" /> Yes</td> </tr> <?php } ?> <tr> <td> <input type="submit" name="Submit" value="Send"></td> </tr></table> </form> </table> Hi, I am using the following PHP email code, and when I send it to my Gmail account it works fine, but some servers are blocking this email and are not being received. How can I tweak it to make it more compatible? Code: [Select] $headers = "From: $row_o_email[email] \r\n"; $headers .= "BCC: $row_o_email[email] \r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $to = $row_e['email']; mail($to, "subject", " email body ", $headers); Hello I'm completely new with php and need some help. Basically I'm at a level that I can tweak it but I'm still learning on how to write it. I have a form within an html page. This form has multiple text inputs and a upload button. Once the user hits the submit button it triggers the mailer.php. I've done tons of searches online today and in forums and people keep mentioning php mailer as a good tool. I looked into this and was confused on how to implement it. I don't need the info sent to a database, just emailed. The uploaded file just needs to be sent to a temp directory and then deleted after the file is emailed. The inputs would be in the body of the email and the uploaded file would be attached. This is the php code I'm working with for a starting point. Any help would be greatly appreciated. Code: [Select] <?PHP $to = "email@email.com"; $subject = "New Employee Application"; $headers = "From:" . $from; $forward = 1; $location = ""; $date = date ("l, F jS, Y"); $redirect = "../thanks.html"; $msg = "New Employee Application. It was submitted on $date.\n\n"; if ($_SERVER['REQUEST_METHOD'] == "POST") { foreach ($_POST as $key => $value) { $msg .= ucfirst ($key) ." : ". $value . "\n"; } } else { foreach ($_GET as $key => $value) { $msg .= ucfirst ($key) ." : ". $value . "\n"; } } mail($to, $subject, $msg, $headers); if ($forward == 1) { header ("Location: $redirect"); } else { echo "Your application has been sent."; } ?> i want send scheduled email. please help me how can i write code in php I am sitting behind a firewall which blocks the http access to all popular free email providers like hotmail.com gmail.com .... The blocking is done by filtering out the domain names. So I am searching for a way to access the mailbox by a third domain e.g. mydomain123.com (which is under my control). I could imagine that there is a PHP code which can be setup on mydomain123.com which accesses the final hotmail.com mailbox by using POP3 fetches and SMTP sends. Is there such an PHP intermediate code? Peter Hello every one i need your help please about this i would like to add this tabs to my facebook fan page i got App allowing me to put php coding or html but i need when some one add his info and click on submit i receive it at my email so can any 1 here help me or tell me what shall i do ? i newbie and hope to get your help guys please Hello, I am creating a website with the use of php and mysql. While I am not advanced, I've been learning quite a bit on php. However, I am looking to build a tracker type script and hide it into my coding so that if someone were to hack into my website and take my website coding, that it would send me an email notifying that they were using my coding. How would I go about this? If you can help me, i'd be glad to credit you! Thank you! |