Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

php email - ignores £ in body

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
eppyfone
Asked:
eppyfone
1 Solution
 
Loganathan NatarajanLAMP DeveloperCommented:
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
 
eppyfoneAuthor Commented:
Hi

Yes

Still no success..
0
 
Ray PaseurCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Kim WalkerWeb Programmer/TechnicianCommented:
Try quoted_printable_encode your message.
quoted_printable_encode($message);

Open in new window

0
 
eppyfoneAuthor Commented:
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
 
Ray PaseurCommented:
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
 
eppyfoneAuthor Commented:
Solved by research elsewhere.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now