Welcome Guest!
Please login
If you do not have an account yet on The Web Squeeze forums, please Register! It’s FREE and there are many benefits:
- Receive Fast Advice
- Learn Programming Languages
- Get Professional Website Reviews
- Quick Troubleshooting Assistance
|
|
[solved] Trouble With New Lines In Mail.
This is a discussion on [solved] Trouble With New Lines In Mail., within the PHP section. This forum and the thread "[solved] Trouble With New Lines In Mail." are both part of the Programming Your Website category.
![]() ![]() |
Jul 28 2008, 08:23 AM
Post
#1
|
|
|
Master of the Universe ![]() Posts: 1,298 Joined: 15-February 08 From: London, England |
I am having trouble with new lines within e-mails. The new lines work up to the $message variable. I will talk you through my code. Could someone point out why the \n are being added to e-mails but they are being interpretted as plain text.
Message is stored as content variable as multiple functions require it. The validate function checks if the $_POST['content'] exists and returns "<em>'Message'</em>" if it isn't found. No string manipulation occurs within the validate function. CODE $this->content = $this->Validate(mysql_real_escape_string($_POST['content']), 'exists', "<em>'Message'</em>"); The send function is run. The relevant part of the send function is the following. The \n I specify up to the $message variable work fine. It is just the message itself which is the problem. CODE $message = $this->content; $email_header = "From: $email_field\n"."Reply-To: $email_field\n"."MIME-Version: 1.0\n"."Content-type: text/plain;"; $email_header = stripslashes(strip_tags(trim($email_header))); $body = "From: $name_field\n E-Mail: $email_field\n Phone:$phone_field\n Message:\n $message"; Any ideas why the \n within message is being interpreted as plain text? EDIT: Moved mysql_real_escape_string to the db function -------------------- |
|
|
If you found The Web Squeeze to be helpful, please donate so we can keep this site FREE, FRESH, and fortified with Web Design & Development info!
![]() ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
19 | alex | 358 | 15th February 2008 - 01:12 PM Last post by: karinne |
|||
![]() |
9 | caminowebmaster | 241 | 15th February 2008 - 06:24 PM Last post by: Jacob |
|||
![]() |
3 | c010depunkk | 452 | 21st February 2008 - 09:41 AM Last post by: c010depunkk |
|||
![]() |
9 | thesealportalteam | 329 | 17th March 2008 - 12:24 PM Last post by: thesealportalteam |
|||
![]() |
6 | Jason | 263 | 27th March 2008 - 09:42 AM Last post by: Jason |
|||






Jul 28 2008, 08:23 AM






