Topic: multipart email using a class works - but issue with POST variable (Read 319 times)
My Name is Enigo Montoya
Posts: 33
188 credits Members referred : 0
« on: Mar 15, 2008, 05:54:39 AM »
The script I am working with uses a class to send multipart/alternative email which works fine. Located here It sends text only, HTML w/attachment, and Multipart both.(I eliminated all but the multipart both). The file where the message is composed contains the following...
I have a multi-line text box and this works for the text only portion, but I am losing the HMTL tags from the FCKeditor.
The tricky part is that if I add content in the editor and view the source I can then copy/paste that exact source into the $htmlVersion var directly and it works like it should. EX.
Code:
$htmlVersion .= "This was created in the <span style='font-weight: bold; font-style: italic;'>FCKeditor</span>";
Both versions are sent, but when I use $_POST['fckeditor']; the HTML version is just the text that was typed in the editor with no formatting. The class takes care of setting the boundary, MIME version 1.0, Content-Transfer-Encoding: base64, so I don't think it is an issue with the class file. I read the other recent posts about phpmailer and swift, but this seems like this is a little bit different issue. I also tried to find a function that would help to retain the HTML tags, but I have tried many things without any luck.
Any help would be appreciated, thank you!
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8037
41179 credits Members referred : 3
« Reply #1 on: Mar 15, 2008, 01:55:27 PM »
This looks like a fckeditor problem. But to be sure, did you tried to print the contents of $_POST['fckeditor'] to the screen before doing anything else?
My Name is Enigo Montoya
Posts: 33
188 credits Members referred : 0
« Reply #2 on: Mar 16, 2008, 03:58:59 AM »
Nikolas,
Right before my forms I added <?php print "" . $_POST['fckeditor'] . "" ?> and when I viewed the email sent...it started to output the HTML, but weird things were happening. Text made to be red in the editor appeared green in the sent mail, and I was getting extra slashes.
Long story short, a client was already using a CMS with FCKeditor pre-built in and the original newsletter only allowed plain text. With the above info I was able to add $htmlVersion = "<html>"; at the top and a close tag at the bottom. The stripslashes function eliminated the slashes, and I had previously changed the images to an absolute path in the editor. It was important for the client to be able to send small photos in the newsletter. After working on this for several days I was finally able to get this to work today!
Thank you!!
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7661