#1
|
||
|
phMailer email format problem
Scott -
I found your phMailer script and intend to use it on the website I maintain for our local youth soccer association. It will be used as a contact form so folks can contact our Board of Directors members (President, Vice President, and so on). I have customized the script some (left all your copyright stuff in it) so that it resembles the look of our website (background image, etc). I have not altered your execution coding. I sent a few test emails to myself using the script. Emails came through ok. But............... The textarea message ($yourmessage) does not appear in the email as it was typed into the text area box. I've looked through your Forum and found no fix for the problem I am seeing. I did see one posts for the same problem, but no explanation or fix for it. Example (textarea box input): This is a test message. LINE 1 LINE 2 LINE 3 END LINE Here is what the message looks like in the received email: This is a test message.LINE 1LINE 2LINE 3END LINE I would like the message to retain the look of what was actually keyed into the text area box. That way if the person that is contacting one of our Board Members keys in their message as different paragraphs, the resulting email will look the same and be more easy on the eyes to read. I've tried some things to fix this problem to no avail. I am not a php expert, just a novice webmaster. I am capable of understanding techiniques and figuring out code logic. But, I am in the learning stages of using php, and am lost on what to do to remedy the problem I am trying to resolve. FYI: My email client is Outlook Express. I don't believe it is the problem, as other form scripts I've used in the past do not do this with textarea inputs. Also, here is some info regarding my site hosting agent: (Not sure if this will help of be of use, but submitting just in case). Platform Type: Debian MySQL Version: MySQL Version 5.0.45 Perl Version: Perl 5.8.8 PHP Version: PHP 5.2.2 Can you help me out on this problem and offer an explanation (and possible fix) on why the textarea message does not include any carriage returns and/or line feeds in the resulting email? Thanks! |
#2
|
||
|
Code:
Line: 179 $key=str_replace("\n", "", $key); Code:
Line 308: $yourmessage=clean(nl2br($yourmessage));
__________________
Last edited by atholon; 01-22-2009 at 03:06 PM. |
#3
|
||
|
I don't have this script (tried downloading it but it didn't work), so I don't know the format the email is sent out in.
Can some one get me a copy of the script, I think I know what to do, but with out testing it/seeing the code I don't know for sure. I know that for windows uses "\r\n\" for enter. Using nl2br only would work if the email is in html format, or being viewed as html, if it is just plain text then it just will clutter the email with the br tags. I would try changing the line that atholon referenced to $key=str_replace("\n", "\r\n", $key); But as I said, with out looking at the code. I don't know what the clean() function does, so it may mess up the replacement. ici |
#4
|
||
|
This should fix your issue:
Line# 308 Replace PHP Code:
PHP Code:
Replace PHP Code:
PHP Code:
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#5
|
|||
|
Quote:
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#6
|
||
|
no errors, windows xp pro, ie7 with ie7pro installed.
Downloading window flashes up for a second then disappears and nothing more happens - doesn't matter if I tell it to save or open. Just went through and none of the downloads from phphq.net work for me. Don't have this issue with any other site I have ever visited |
#7
|
||
|
Ahh missed that part, thx scott.
__________________
|
#8
|
||
|
Scott -
Thanks for the quick reply and the help. I changed the lines of code as you suggested and it did the trick. The received email retains the format of the text just as entered in the text box now. Will be implementing use of the script on our soccer association website real soon. And with your copyright notice and link to phphq.net. Again, thanks for the script and your quick support! Charlie |
#9
|
||||
|
Quote:
Quote:
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#10
|
||
|
Download worked ok in firefox 3.0.3 - have you tried it your self in IE? maybe it is just me, though would be very weird for only one site to have issues like that lol
|
#11
|
||
|
Worked fine for me bro.
__________________
|
#12
|
||
|
i've tried ie6, ie7 and 8... all work fine. That's really weird.
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Forum format changed? | Guest001 | General Chat | 11 | 06-28-2011 05:30 PM |
PHmailer with 7 attachments getts error message and text but not attachments in email sent | Idiotsavant | phphq.Net Forums | 4 | 09-08-2010 06:02 PM |
How do I change tabs and format | GÂ~ûrÐêâd ~DW~ | phphq.Net Forums | 0 | 03-30-2006 08:53 AM |
Format checklist - what to backup? | Steve | Tech Support | 15 | 09-25-2005 12:34 PM |
Changing SS Format in DFX | DevilDog#1 | Delta Force | 4 | 04-29-2005 10:45 PM |