Flash/PHP Mail
Posted: Thu Feb 21, 2008 2:18 pm
Hi all -
I have a designed a Flash based interface to send email via PHP.
I capture the variables in Flash using:
Everything is working fine, but when the message is received all line breaks entered in Flash message field are deleted making the message one long line. Is there something I need to write into my actionscript/php to allow the message to display properly (including manual line breaks)? I'm guessing (hoping!) it's an easy fix.
Thanks in advance -
sleepydad
I have a designed a Flash based interface to send email via PHP.
I capture the variables in Flash using:
Code: Select all
var my_lv:LoadVars=new LoadVars();
my_lv.name=name_txt.text;
my_lv.message=message_txt.text;
// ...
// ...
my_lv.send("mail.php","POST");
My PHP reads:
<?php
$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["from"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["from"] . "\r\n";
$headers .= "Return-Path: " . $_POST["from"];
$to = $_POST['to'];
$message=stripslashes($_POST['message']);
//NOTE: I tried $message without stripslashes - same results
$subject=stripslashes($_POST['subject']);
mail($to, $subject, $message, $headers);
?>
Thanks in advance -
sleepydad