8, September 2008

multipart email using a class works - but issue with POST variable - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: multipart email using a class works - but issue with POST variable
« previous next »
Pages: [1] Print

Author 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 Visit through proxy   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...

Code:
$textVersion = "Hello World!";
$htmlVersion = "<font face='verdana' color='blue'><b>Hello World!</b></font>";

I changed this to...(multiple lines now above these lines for each version so the . before the = sign)
Code:
$textVersion .= $_POST['text_message'];
$htmlVersion .= $_POST['fckeditor'];

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: Male
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?

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
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. Shocked

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
Tags : multipart email fckeditor Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: multipart email using a class works - but issue with POST variable
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep 08, 2008, 06:42:09 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.302
Total Topics: 7.479
Total Members: 3.907
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: phpprofit

15 Guests, 5 Users online :

6 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.