-
Mailform PHP annoyance
Hey all, I have a mailform.php that is sent to my email address via my flash site. I get the emails just fine, but there is all sort formatting information that gets in the way of viewing the message.
Here is an example email i sent myself:
Josh Sawyer Photography
First Name: <P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">Josh </FONT></P>
Last Name: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">Sawyer</FONT></P></TEXTFORMAT>
Email: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">Info@joshsawyer.com</FONT></P></TEXTFORMAT>
Telephone: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">555-555-5555</FONT></P></TEXTFORMAT>
The visitor commented:
------------------------------
<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">test email to demonstrate the formatting issues I am having.</FONT></P></TEXTFORMAT>
------------------------------
Is there an easy way to get rid of all the formatting info?
is this a flash issue or a php issue?
Thanks!
-
Bearded (M|G)od
That is a Flash issue, and I know what the problem is, but it's hard to tell you what to do to fix it without seeing your code now.
-
Button action:
on (release) {
if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5)) {
action = "Send";
loadVariablesNum("mailform.php", 0, "POST");
nextFrame();
} else {
vemail = "Please enter a valid email";
action = "";
stop();
}
}
Frame Action:
fscommand ("allowscale", "false");
mailform = "mailform.php";
action = "";
stop ();
Any Help is greatly appreciated! Thanks in advance.
-
Running on Flash CS3 using action script 2.0 if it matters.
-
The structure of the mail (especially the headers), has to be just so, which can be difficult depending on the mail service you are having trouble with. If the server the mail is coming from, is on a list, that can also be a problem. Which is why it would be difficult to just post a script that would work for you.
-
Bearded (M|G)od
jsfoto, your problem is from using the loadVariablesNum() function. It's old, and shouldn't be used anymore. loadVariablesNum() is pulling in the html version of your text field. Switch to using the LoadVars class. It's hard to post your new AS function because I'd need to know what variables you need to send to your script, as well as text field instance names, but this will push you in the right direction:
Code:
var lv:LoadVars = new LoadVars();
lv.email = "hey@somewhere.com";
lv.variable2 = "Awesome!";
lv.comment = "Hey, great site!";
lv.onLoad = function($success:Boolean):Void
{
if(!$success)
{
doError(); // whatever you'd want to do if there was an error
return;
}
emailWasSent(); // whatever you'd want to do if the email was sent correctly
};
lv.sendAndLoad("mailform.php", lv, "POST");
msn90, that is completely irrelevant to the question.
-
Great, Thanks! Sorry for the delay.
I will give this a shot.
Much appreciated!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|