Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-22-2009, 11:45 AM
Charlie is offline Charlie
Registered User

Join Date: Jan 2009
Posts: 2

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!
Reply With Quote
  #2  
Old 01-22-2009, 02:56 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Code:
Line: 179
$key=str_replace("\n", "", $key);
Is part of the problem. You might want to run nl2br before running the clean function.
Code:
Line 308:
$yourmessage=clean(nl2br($yourmessage));
__________________

Last edited by atholon; 01-22-2009 at 03:06 PM.
Reply With Quote
  #3  
Old 01-22-2009, 04:02 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
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
Reply With Quote
  #4  
Old 01-22-2009, 10:15 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,921

This should fix your issue:

Line# 308
Replace
PHP Code:
$yourmessage=clean($yourmessage); 
With
PHP Code:
$yourmessage=clean(nl2br($yourmessage)); 
Line# 326
Replace
PHP Code:
$message.="Content-Type: text/plain; charset=\"iso-8859-1\"\n"
With
PHP Code:
$message.="Content-Type: text/html; charset=\"iso-8859-1\"\n"
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #5  
Old 01-22-2009, 10:18 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,921

Quote:
Originally posted by icishoot
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.
Any errors? Which browser, os?
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #6  
Old 01-22-2009, 10:53 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
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
Reply With Quote
  #7  
Old 01-23-2009, 12:31 AM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Ahh missed that part, thx scott.
__________________
Reply With Quote
  #8  
Old 01-23-2009, 10:32 AM
Charlie is offline Charlie
Registered User

Join Date: Jan 2009
Posts: 2

Smile

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
Reply With Quote
  #9  
Old 01-23-2009, 10:55 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,921

Quote:
Originally posted by icishoot
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
weird... i will try to fix this this weekend... can you possibly try with another browser?

Quote:
Originally posted by Charlie
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
Your welcome!
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #10  
Old 01-23-2009, 05:42 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
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
Reply With Quote
  #11  
Old 01-23-2009, 05:57 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Worked fine for me bro.
__________________
Reply With Quote
  #12  
Old 01-23-2009, 06:09 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,921

i've tried ie6, ie7 and 8... all work fine. That's really weird.
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -5. The time now is 05:04 AM.




Powered by vBulletin®