PHP - My Sendmail.php Only Sends 2 Variables
Here is my sendmail.php code:
<?php //capture form data in name/value structure //ie. fName = "Pouya" $fNameVar = $_POST['fName']; $lNameVar = $_POST['lName']; $emailVar = $_POST['email']; $commentVar = $_POST['comment']; $telVar = $_POST['tel']; //echo "First Name is {$fNameVar}, last name is {$lNameVar}, email is {$emailVar} and comment is {$commentVar}"; // The e-mail function requires 3 types of info // A. Destination e-mail // B. Subject line // C. Body of your message // D. E-mail of sender mail("puya.turkiyan@gmail.com", "Message from my New Media Sources", $commentVar, "From:$emailVar"); //echo "Thank you $fNameVar" header("Location:thankyou.php"); ?> In the mail section I can only send 2 variables. As soon as I add the third it doesn't even send anything to my e-mail. Please help, its driving me crazy. Here is my table page: <?php include "header.html"; ?> <div id="templatemo_menu"> <ul> <li><a href="index.php">Home</a></li> <li><a href="about.php">About Us</a></li> <li><a href="services.php">Services</a></li> <li><a href="gallery.php">Gallery</a></li> <li><a href="#">Blog</a></li> <li><a href="contact.php" class="current">Contact Us</a></li> </ul> </div> <!-- end of templatemo_menu --> <?php include "socialmedia.html"; ?> <div class="cleaner"></div> </div> <div class="cleaner"></div> </div> <!-- end of header --> </div> <!-- end of header_wrapper --> <div id="templatemo_content_wrapper"> <div id="templatemo_content"> <h1>Contact Information</h1> <p>Here are a few ways to get a hold of us. The best way would be e-mail or phone but you can also use other methods such as <a href="http://www.twitter.com/pehlavoon"><img src="images/twitter-1.png" alt="twitter" width="30" height="30"/> </a> or <a href="http://www.facebook.com/puya.turkiyan"><img src="images/facebook-1.png" alt="facebook" width="30" height="30"/></a> to contact us.</p> <div class="cleaner_h50"></div> <div class="two_column float_l"> <div id="contact_form"> <h2>Contact Form</h2> <fieldset> <legend>Contact me</legend> <form action="sendmail.php" method="post"> <ul> <li><label for="fName">First Name: </label> <input type="text" name="fName" value="" id="fName" /></li> <li><label for="lName">Last Name: </label> <input type="text" name="lName" value="" id="lName" /></li> <li><label for="email">E-mail: </label> <input type="text" name="email" value="" id="email" /></li> <li><label for="tel">Phone number: </label> <input type="text" name="tel" value="" id="tel" /></li> <li><label for="comment">comment: </label> <textarea cols="5" rows="5" name="comment" id="comment"></textarea></li> <li><input type="submit" value="Send" /></li> </ul> </form> </fieldset> </div> </div> <div class="two_column float_r"> <h6>Contact our development team:</h6> Located in Vancouver Canada<br /> <strong>Email:</strong> <a href="mailto:puya.turkiyan@gmail.com">puya.turkiyan@gmail.com</a> <p><strong>Phone:</strong> 1+778-991-7892</p> <div class="cleaner_h60"></div> <h6>Contact our Account manager</h6> Located in Downtown Vancouver Canada<br /> <strong>Email:</strong> <a href="mailto:richardboulier@gmail.com">richardboulier@gmail.com</a> <p><strong>Phone:</strong> 1+778-230-1084</p> </div> <div class="cleaner"></div> </div> <!-- end of content --> </div> <!-- end of content_wrapper --> <?php include "footer.html"; ?> Take a look and see if you can help me. Similar TutorialsHello I'm on the verge of damaging my computer, please help... The below is my first PHP script - it works about once every 20 attempts, sending the email message. I've tried moving the header bit around, so it's inside the if statement, but it is still only intermittently successful. For the sake of this PC, please help out Best Wishes <? function checkOK($field) { if (eregi("\r",$field) || eregi("\n",$field)){ die("Invalid Input!"); } } $select=$_POST['select']; checkOK($select); $name=$_POST['name']; checkOK($name); $email=$_POST['email']; checkOK($email); $confirmail=$_POST['confirmail']; checkOK($confirmail); $month=$_POST['month']; checkOK($month); $day=$_POST['day']; checkOK($day); $year=$_POST['year']; checkOK($year); $leaving=$_POST['leaving']; checkOK($leaving); $hour=$_POST['hour']; checkOK($hour); $minutes=$_POST['minutes']; checkOK($minutes); $ampm=$_POST['ampm']; checkOK($ampm); $going=$_POST['going']; checkOK($going); $flightnumber=$_POST['flightnumber']; checkOK($flightnumber); $pay=$_POST['pay']; checkOK($pay); $song=$_POST['song']; checkOK($song); $comments=$_POST['comments']; checkOK($comments); $to="beepbeepyeah@kabeoke.com"; $message="Message Type: $select\n\nName: $name\n\nEmail: $email\n\n$confirmail\n\nDate of Journey: $month, $day, $year\n\nLeaving From: $leaving\n\nDeparture Time: $hour:$minutes $ampm\n\nGoing to: $going\n\nFlight Number: $flightnumber\n\nPayment Method: $pay\n\nSong Requests: $song\n\nComments: $comments"; header('Location:http://www.kabeoke.com'); if(mail($to,"Slap it - booking/enquiry from Kabeoke.com!",$message,"From: $email\n")){ } else { echo "There was a problem sending the mail. Please check that you filled in the form correctly."; } ?> Hey, I have a submission form to ask for support to my support email. But when i recieve messages the break lines are not counted for and i get the r/n. I then added the nl2br($Message) but that also does not work.... and so im not sure how i solve it ... here is my script: <?php If(isset($_POST['Send'])){ $supportemail ='support@mydomain.com'; $Username = $_POST['Username']; $Email = $_POST['Email']; If(strlen($Email)<3){ ?> Invalid email address! <br /> <a href="index.php">Continue</a> <br /><br /> <?php }Else{ $subject = 'I am requesting help!'; $headers = 'From: '.$Email.' <'.$Email.'>'."\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n"; $headers .= 'mailed-by: text/html; charset=iso-8859-1'."\r\n"; $message = "<b>".ucwords($Username)."</b> has requested help ! <br /><br />"; $message .= "Their message is: <br /><b>".nl2br($_POST['letter'])."</b> <br /><br />"; $message .= "Email is: <b>".$Email."</b>"; mail('$supportemail', $subject, $message, $headers); ?> Your message has succesfully been sent, you will be contacted by the email "<? echo $Email; ?>" that you have provided as soon as possible! <a href="index.php">Continue</a> <br /><br /> <?php } ?> Hope you can help! I'm working on learning AJAX, all is fine with that script as it's from a book. The issue I'm having is the PHP server side code to get a response from the server. I'm still rather new to all of this so try to explain any response given in a noob friendly manner. So I have the following so far: // Connection Values $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // Get the variable sent by AJAX script if (isset($_GET['username'])) { // Secure the information $passname = mysqli_real_escape_string($dbc, trim($_GET['username'])); // Lookup the username in the database $query = "SELECT username FROM information WHERE username = '$passname'"; $data = mysqli_query($dbc, $query); // Allow some time to get the response sleep(2); // If 1 is returned that name exsists, if 0 then we can move forward if (mysqli_num_rows($data) == 0) { // Send okay back to the ajax script so it knows to stop bothering the user echo 'okay'; } else { // Send denied back to the ajax script so the user knows that name is taken echo 'denied'; } } This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=344364.0 Hi I'm not a coder so don't know how to write this myself. I'm very much of the copy and paste type. Basically I want a file to be downloaded and an email sent when either a link is clicked or a submit button is pressed. This is so that when a particular file hosted on my site (a pdf) is downloaded I am alerted to this by an email notification. Can anyone help me out with this? I assume that this can be done with PHP and MySQL but am open to suggestions. Thanks in advance for your help Stephen I am getting an error on a form which sends an email if the form is succesfull. I think there may ne an issue with the sendmail function. I am using a hosting company and not sure if sendmail is something that has to be enabled in the .ini file. Is there any way to check without getting the hosting company involved? This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=359470.0 I wrote this code and I keep getting Parse error: syntax error, unexpected $end in the last line <?php $subject = 'Registration'; $fname = $_POST['fname']; $lname = $_POST['lname']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $phone = $_POST['phone']; $email = $_POST['email']; $mortgage = $_POST['mortgage']; $comments = $_POST['comments']; if($fname == ""){ echo 'Please fill out a First Name'; exit(); }elseif($lname == ""){ echo 'Please fill out a Last Name'; exit(); }elseif($address == ""){ echo 'Please fill out an Address'; exit(); }elseif($city == ""){ echo 'Please fill out a City'; exit(); }elseif($state == ""){ echo 'Please fill out a State'; exit(); }elseif($zip == ""){ echo 'Please fill out your Zip Code'; exit(); }elseif($phone == "") { echo 'Please fill out a Telephone Number'; exit(); }elseif($mortgage == "") { echo 'Please fill out a Mortgage Company'; exit(); }else{ $to = 'amphit@live.com'; $mailfrom = '$email'; $header = "from: $fname $lname <$mail_from>"; $detail = "First name - $fname <br> Last Name - $lname <br> Address - $address <br> City - $city <br> State - $state <br> Zip - $zip <br> Phone - $phone <br> Email - $email <br> Mortgage - $mortgage <br> Comments - $comments"; $send_mail=mail($to,$subject,$detail,$header); if($send_mail){ echo "We've recived your contact information"; } else { echo "ERROR"; } ?> Hi, my webhost has the mail() function disabled. However, my emails are hosted in the offices sever and can't use smtp due to the firewall blocking it. How do I setup sendmail instead of the mail(). I tried googling this but keep coming across to the mail() functions. Hello, I am using the Pear Mail and Mail_Mime packages to send SMTP authenticated HTML formatted emails. I was successfully sending emails when I started getting the following error: sendmail: 451 Internal Error I check out the sendmail logs at /var/log/mail.log but that only says the same thing. I am running Linux-Ubuntu and sending emails from an address on a remote server (godaddy hosted). The interesting thing is that this exact same code will run to completion and fail. Any thoughts? Anyone with Pear Mail experience, is there any way to end the SMTP session, maybe that is the problem. I also think an issue might be that the server thinks my IP is sending too many emails, any way to provision against that? Thanks for any insight and please let me know if other information might be helpful to debug this. Had the following code working for months and now its not working anymore??? I dont't think the code is the correct way to do it but it did work, Can someone please look at it or give me the correct code. All I am trying to do is take the data from the form and email it to an email address and cc the user that filled out the form. I would like to add a bcc in the future. Here is my current code <?php $email = $_POST['EMAIL']; $mailto = "user@domain.com, user@domain.org"; $mailhead = "FROM: LOI<user@domain.org>"."\r\n"; $mailhead .= "Reply-To: user@domain.org"."\r\n"; $mailhead .= "CC: ".$email; $mailbody = "Values submitted from LOI:\n"; while (list($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); header("LOCATION: letter.html"); ?> (my file structure is the following. inquiry.html has a form and the submit button goes to letter.php(code above) then it directs to letter.html) Thanks Trevor Hi I am having a problem with the code below I am using to send a simple php email form. I am not that advanced with php but I want to add a drop down menu to a form I created and not sure how to get get the message (warning not completed) in the field - if(empty($visitortitle)) { - to accept or not to accept? This is the code in the form: <td align="left"><select name="visitortitle"> <option>Please Select</option> <option>Mr</option> <option>Mrs</option> <option>Miss</option> <option>Ms</option> <option>Dr</option> </select> This is the code I have got in the sendemail: if(empty($visitortitle)) { echo "<h2><br /><br /><br /><br />Please hit the back button and enter the title drop down box correctly<br />before you try submitting the form again.</h2>\n"; die ( '<a href="forum.html">click here go back and try again</a>' ); } How can I get this code to recognise that a <option></option> has been selected? Any help would be appreciated. Thanks Gary Hi guys I'm seriously stressing hard about this. I seem to have written everything properly but my contact form just won't send an e-mail and update the status on my webpage. I fill out the details on my contact form and my status text stays on "Email is sending...". I'd REALLY REALLY appreciate any help you could toss my way. Thanks a ton! sendmail.php <?php $name = @trim(stripslashes($_POST['name'])); $from = @trim(stripslashes($_POST['email'])); $subject = @trim(stripslashes($_POST['subject'])); $message = @trim(stripslashes($_POST['message'])); $to = 'myemail@gmail.com';//replace with your email $headers = array(); $headers[] = "MIME-Version: 1.0"; $headers[] = "Content-type: text/plain; charset=iso-8859-1"; $headers[] = "From: {$name} <{$from}>"; $headers[] = "Reply-To: <{$from}>"; $headers[] = "Subject: {$subject}"; $headers[] = "X-Mailer: PHP/".phpversion(); mail($to, $subject, $message, $headers); die(); ?> main.js //Contact Form var form = $('#contact-form'); form.submit(function(event){ event.preventDefault(); var form_status = $('.form-status'); $.ajax({ url: $(this).attr('action'), beforeSend: function(){ form_status.find('.form-status-content').html('<p><i class="fa fa-spinner fa-spin"></i> Email is sending...</p>').fadeIn(); } }).done(function(data){ form_status.find('.form-status-content').html('<p class="text-success">Thank you for contact us. As early as possible we will contact you</p>').delay(3000).fadeOut(); }); }); contact.html <form class="form-horizontal" id="contact-form" role="form"> <div class="form-group form-status"> <div class="col-sm-offset-2 col-sm-6"> <div class="form-status-content"> </div> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-6"> <input type="text" name="name" class="form-control input-lg" placeholder="Name" required="required"> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-6"> <input type="email" name="email" class="form-control input-lg" placeholder="Email" required="required"> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-6"> <input type="text" name="subject" class="form-control input-lg" placeholder="Subject" required="required"> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-8"> <textarea name="message" rows="6" class="form-control input-lg" placeholder="Message" required="required"> </textarea> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-8"> <button type="submit" class="btn btn-lg btn-transparent">Submit</button> </div> </div> </form> Edited February 27, 2020 by g0dtier This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=313491.0 I Have the following issue and I spend my whole day looking for it. I have a database with a simple admin where I add/delete values. The database structure is the following: id, zip, email The database is called zipdatabase Here is the mailing part: Code: [Select] //headers $headers = "From: <$Email>"; $headers .= "\r\nBcc: <$Bcc>\r\n\r\n"; // send email $success = mail($EmailTo, $Subject, $Body, $headers);The variable $Bcc must come from the database. I am really ignorant so I only got to a point on how to echo the results I need (and this works): Code: [Select] $query = "SELECT email FROM zipdatabase WHERE zip = '$ZIP'"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { echo "{$r['email']}, "; } ?> For a zip I get more than one result so when I tried using this Code: [Select] $query = "SELECT email FROM zipdatabase WHERE zip = '$ZIP'"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { $Bcc = "{$r['email']}, "; } echo "Bcc" ?> It only gives me one result. What I noticed is I have 2 issues: - I can't extract the BCC from the database - I don't know how to add more email addresses to the bcc field, I only managed to add more addresses to the $Emailto like: Code: [Select] $EmailTo = "address1@domain.com, address2@domain.com"; $Bcc = "address3@domain.com"; All these variables are defined by a webform and it works flawlessly except the database problem: Code: [Select] $Name = Trim(stripslashes($_POST['Name'])); $Phone = Trim(stripslashes($_POST['Phone'])); $ZIP = Trim(stripslashes($_POST['ZIP'])); $Email = Trim(stripslashes($_POST['Email'])); $Message = Trim(stripslashes($_POST['Message'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=contacterror.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Phone: "; $Body .= $Phone; $Body .= "\n"; $Body .= "ZIP: "; $Body .= $ZIP; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Message: "; $Body .= $Message; $Body .= "\n"; Sorry for my ignorance and hope someone here can help. The webform works perfectly except the bcc from the database part. I've got PHP setup on Ubuntu with MySQL. I've got sendmail installed but for some reason I can't get mail() to work. Does anyone have good guidelines for getting this setup properly? First off, I am new to PHP, and want to learn it, but it seems very complicated. Where do I begin? I found a script online for a contact form and I am having trouble making it work for my needs. I wanted to include a phone number field in the email message. This is what I have so far for the PHP, but it does not include the phone field in the body of the message. Everything else works fine. Apologize in advance if this message has been posted many times before. <?php $post = (!empty($_POST)) ? true : false; if($post) { include 'functions.php'; $name = stripslashes($_POST['contactname']); $email = trim($_POST['email']); $subject = "New Message from your website"; $message = stripslashes($_POST['message']); $phone = stripslashes($_POST['phone']); $error = ''; // Check name if(!$name) { $error .= 'Please enter your name.<br />'; } // Check email if(!$email) { $error .= 'Please enter an e-mail address.<br />'; } if($email && !ValidateEmail($email)) { $error .= 'Please enter a valid e-mail address.<br />'; } // Check message (length) if(!$message || strlen($message) < 15) { $error .= "Please enter your message. It should have at least 15 characters.<br />"; } if(!$error) { $mail = mail(WEBMASTER_EMAIL, $subject, $message, "From: ".$name." <".$email.">\r\n" ."Reply-To: ".$email."\r\n" ."X-Mailer: PHP/" . phpversion()); if($mail) { echo 'OK'; } } else { echo '<div class="notification_error">'.$error.'</div>'; } } ?> Here is one of my emails. Delivered-To: jason@gmail.com Received: by 10.204.57.134 with SMTP id c6cs22321bkh; Tue, 13 Sep 2011 07:23:32 -0700 (PDT) Received: by 10.101.168.12 with SMTP id v12mr3751263ano.48.1315923810914; Tue, 13 Sep 2011 07:23:30 -0700 (PDT) Return-Path: <contact@big.com> Received: from big.com (big.com [173.0.59.100]) by mx.google.com with ESMTP id c19si889696anj.173.2011.09.13.07.23.29; Tue, 13 Sep 2011 07:23:29 -0700 (PDT) Received-SPF: pass (google.com: domain of contact@big.com designates 173.0.59.100 as permitted sender) client-ip=173.0.59.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of contact@big.com designates 173.0.59.100 as permitted sender) smtp.mail=contact@big.com; dkim=neutral (body hash did not verify) header.i=@big.com Received: by big.com (Postfix, from userid 33) id 1BDCE2F4041A; Tue, 13 Sep 2011 10:23:20 -0400 (EDT) DKIM-Signatu v=1; a=rsa-sha256; c=simple/simple; d=big.com; s=mail; t=1315923800; bh=ysNGlrscqmqCPbqxJlWWHLaW3SU6MgDVQCze+cevPS4=; h=To:Subject:Message-ID:Date:MIME-Version:Sender:From:Reply-To: Content-Type; b=PDPCRvKGQRP3LeeDNhZQwbX6aMXOZEyqRXV1E+kuDDq05NYRIrmJCcQRhwEIaSosh yoZ0pF5wtrXjgY1KA0hgee7qzSVDhweguBfOydn1qE6nsL1pq CQgsHmtvu9dwPGw9z uUEHM9bg5DwiG0RT5KLYf4oZTJmJpc8n2oyK26/I= To: jason@gmail.com Subject: Closed Beta Invitation from Jason Gordon Message-ID: <87847890-050333@big.com> Date: Tue, 13 Sep 2011 10:38:17 -0400 MIME-Version: 1.0 X-Mailer: PHP-5.3.8 X-Sender: "big" <contact@big.com> X-Priority: 3 Organization: big Errors-To: contact@big.com Sender: contact@big.com From: "big" <contact@big.com> Reply-To: "big" <contact@big.com> Content-Type: multipart/alternative; boundary=87847890 --48673093 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <a href="http://big.com/u/jasonGordon?utm_source=beta_invite&utm_medium=email&utm_content=referer_name&utm_campaign=join_beta" alt="Jason Gordon's profile" title="Jason Gordon's profile">Jason Gordon</a> invited you to join the newest community of entreprenuers and investors, big. Why participate in our closed beta? Here you will be able to find, research and connect with entrepreneurs or investor so much easier than ever before. You will be one of the first people to ever lay eyes on our exclusive software! Sign up by clicking <a href="http://big.com/join?9b782e=&key=7RG5poe9lgxmUSIcQTPji8EtFMnXyOYW3Cf&utm_source=beta_invite&utm_medium=email&utm_content=sign_up&utm_campaign=join_beta" title="big Beta Referral">here</a> If the link does not work, go to <a href="http://big.com" title="big">big.com</a>, click "Join big" and enter your closed beta access key. Your closed beta access key is: 7RG5poe9lgxmUSIcQTPji8EtFMnXyOYW3Cf Please leave us feedback so that we can improve our software. big Team --48673093 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Closed Beta Invitation</title> </head> <body> <table width="500px" cellspacing="0" cellpadding="13" style="border: 1px solid #e7e7e7;"> <tr> <td> <table cellspacing="0" cellpadding="5" bgcolor="#ffffff" width="480px" style="border: 1px solid #999999;"> <tr> <td bgcolor="#489fcc" cellspacing="15" style="border-bottom: 1px solid #999999; border-top: 0; border-left: 0; border-right: 0; font-family: verdana; letter-spacing: 1px; font-weight: bold; color: white;" width="480px"> big </td> </tr> <tr> <td> <table style="line-height: 26px; font-family: arial; font-size: 13px;" width="100%" cellspacing="10" cellpadding="0"> <tr> <td width="100%"> <table style="line-height: 26px; text-align: justify;" width="100%" cellpadding="0" cellspacing="0"> <tr> <td width="100%"> <a href="http://big.com/u/jasonGordon?utm_source=beta_invite&utm_medium=email&utm_content=referer_name&utm_campaign=join_beta" alt="Jason Gordon's profile" title="Jason Gordon's profile">Jason Gordon</a> invited you to join the newest community of entreprenuers and investors, big. Why participate in our closed beta? Here you will be able to find, research and connect with entrepreneurs or investor so much easier than ever before. You will be one of the first people to ever lay eyes on our exclusive software! </td> </tr> </table> </td> </tr> <tr> <td align="center" width="100%"> <table style="border-top: 1px solid #b8b8b8; border-bottom: 1px solid #b8b8b8;" width="100%" cellpadding="0" cellspacing="5"> <tr> <td width="100%" align="center"> Sign up by clicking <a href="http://big.com/join?9b782e=&key=7RG5poe9lgxmUSIcQTPji8EtFMnXyOYW3Cf&utm_source=beta_invite&utm_medium=email&utm_content=sign_up&utm_campaign=join_beta" title="big Beta Referral">here</a> </td> </tr> </table> </td> </tr> <tr> <td width="100%" style="text-align: justify;"> If the link does not work, go to <a href="http://big.com" title="big">big.com</a>, click "Join big" and enter your closed beta access key. Your closed beta access key is: </td> </tr> <tr> <td align="center" width="100%"> <table bgcolor="#e6e6e6" style="border: 1px solid #b8b8b8;" width="100%" cellpadding="0" cellspacing="5"> <tr> <td width="100%" align="center"> 7RG5poe9lgxmUSIcQTPji8EtFMnXyOYW3Cf </td> </tr> </table> </td> </tr> <tr> <td width="100%"> Please leave us feedback so that we can improve our software. </td> </tr><tr> <td width="100%"> big Team </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> </html> --48673093-- My headers function is... Code: [Select] function mail_header ($type, $random_hash) { $type = (int)$type; if ($type === 0) { $boundary = $random_hash; $x_mailer = phpversion(); $time_stamp = date("r"); $headers = 'Message-ID: <'.$boundary.'-050333@big.com>' . "\r\n"; $headers .= 'Date: ' . $time_stamp . "\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'X-Mailer: PHP-' . $x_mailer . "\r\n"; $headers .= 'X-Sender: "big" <contact@big.com>' . "\r\n"; $headers .= 'X-Priority: 3' . "\r\n"; $headers .= 'Organization: big' . "\r\n"; $headers .= 'Errors-To: contact@big.com' . "\r\n"; $headers .= 'Sender: contact@big.com' . "\r\n"; $headers .= 'From: "big" <contact@big.com>' . "\r\n"; $headers .= 'Reply-To: "big" <contact@big.com>' . "\r\n"; $headers .= 'Return-Path: "big" <contact@big.com>' . "\r\n"; $headers .= 'Content-Type: multipart/alternative; boundary=' . $boundary . "\r\n"; } return $headers; } does anyone know how to decode this XML variable value into string values? I also need to know the oposite way: creating variable values into xml. I've tried several code examples but they did filter the requested data. Code: [Select] $xml='<?xml version="1.0" encoding="utf-8"?> <elements> <text identifier="ed9cdd4c-ae8b-4ecb-bca7-e12a5153bc02"> <value/> </text> <textarea identifier="a77f06fc-1561-453c-a429-8dd05cdc29f5"> <value><![CDATA[<p style="text-align: justify;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>]]></value> </textarea> <textarea identifier="1a85a7a6-2aba-4480-925b-6b97d311ee6c"> <value><![CDATA[<p style="text-align: justify;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>]]></value> </textarea> <image identifier="ffcc1c50-8dbd-4115-b463-b43bdcd44a57"> <file><![CDATA[images/stories/red/cars/autobedrijf.png]]></file> <title/> <link/> <target/> <rel/> <lightbox_image/> <width><![CDATA[250]]></width> <height><![CDATA[187]]></height> </image> <text identifier="4339a108-f907-4661-9aab-d6f3f00e736e"> <value><![CDATA[Kramer 5]]></value> </text> <text identifier="ea0666d7-51e3-4e52-8617-25e3ad61f8b8"> <value><![CDATA[6000 RS]]></value> </text> <text identifier="90a18889-884b-4d53-a302-4e6e4595efa0"> <value><![CDATA[Eindhoven]]></value> </text> <text identifier="410d72e0-29b3-4a92-b7d7-f01e828b1586"> <value><![CDATA[APK Pick up and return]]></value> </text> <text identifier="45b86f23-e656-4a81-bb8f-84e5ea76f71f"> <value><![CDATA[15% korting op grote beurt]]></value> </text> <text identifier="3dbbe1c6-15d6-4375-9f2f-f0e7287e29f3"> <value><![CDATA[Gratis opslag zomerbanden]]></value> </text> <text identifier="2e878db0-605d-4d58-9806-8e75bced67a4"> <value><![CDATA[Gratis abonnement of grote beurt]]></value> </text> <text identifier="94e3e08f-e008-487b-9cbd-25d108a9705e"> <value/> </text> <text identifier="73e74b73-f509-4de7-91cf-e919d14bdb0b"> <value/> </text> <text identifier="b870164b-fe78-45b0-b840-8ebceb9b9cb6"> <value><![CDATA[040 123 45 67]]></value> </text> <text identifier="8a91aab2-7862-4a04-bd28-07f1ff4acce5"> <value/> </text> <email identifier="3f15b5e4-0dea-4114-a870-1106b85248de"> <value/> <text/> <subject/> <body/> </email> <link identifier="0b3d983e-b2fa-4728-afa0-a0b640fa34dc"> <value/> <text/> <target/> <custom_title/> <rel/> </link> <relateditems identifier="7056f1d2-5253-40b6-8efd-d289b10a8c69"/> <rating identifier="cf6dd846-5774-47aa-8ca7-c1623c06e130"> <votes><![CDATA[1]]></votes> <value><![CDATA[1.0000]]></value> </rating> <googlemaps identifier="160bd40a-3e0e-48de-b6cd-56cdcc9db892"> <location><![CDATA[50.895711,5.955427]]></location> </googlemaps> </elements>'; This topic has been moved to Linux. http://www.phpfreaks.com/forums/index.php?topic=318175.0 |