Solved

php email - ignores £ in body

Posted on 2012-03-28
7
233 Views
Last Modified: 2012-04-02
Hi

I am sending out an email with php.

If the body of the email contains '£' the whole email is blank.

If I use '£' It simply ignores it.

Here's the basis of the function ..

$header = "Content-Type: text/html; charset=utf8";
$subject = "My Subject Here";
$body1 = "This is the first section where I try £15";
$body2 = "This is the second section where I try £15";
$from = "My From Address";
$language = language_default();
$params = array();
$message['subject'] = $subject;
		$message['body'] = array();
		$message['body'][] = $body1;
		$message['body'][] = $body2;

Open in new window

0
Comment
Question by:eppyfone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 37776216
do u have like this full mime header,


// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
0
 

Author Comment

by:eppyfone
ID: 37776260
Hi

Yes

Still no success..
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 37776269
You probably have other errors, but this line will cause an encoding collision between the unicode marker and the single-byte characters with ordinal values above 128.
$header = "Content-Type: text/html; charset=utf8";

Open in new window

Please read this article about unicode and then post back if you still have questions.
http://www.joelonsoftware.com/articles/Unicode.html

Executive Summary: Remove UTF-8 and insert ISO-8859-1.  But read the article to learn why so you don't have this situation again.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:Kim Walker
ID: 37776272
Try quoted_printable_encode your message.
quoted_printable_encode($message);

Open in new window

0
 

Accepted Solution

by:
eppyfone earned 0 total points
ID: 37776740
1. Ray Passeur - thanks for the attempt at trying to teach me to fish. No use. and your Exec Summary didn't work ..

2. xmediaman - nope

Solution by me :

Added this line

            $message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed';

Thanks for your attention

E.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 37776773
Yeah, that's the problem with posting little code fragments.  It's almost impossible to guess at what else is going on.  We could see that your script had set a lot of variables, but nowhere was there a function call that used any of those variables.  So all we could do is guess at the more common errors associated with character encodings.

Anyway, glad you've found the issue.  Best regards, ~Ray
0
 

Author Closing Comment

by:eppyfone
ID: 37795082
Solved by research elsewhere.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 71
Compute age Html 2 27
How to show popup no matter what a user clicks on navigation wise 10 36
Can't get video to center on page 2 17
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question