homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Quoted Printable Email
Sending a test quoted printable email message.
JAB Creations

 1:12 am on Jul 15, 2013 (gmt 0)

I'm trying to send myself a quoted printable email for testing purposes. I'm limited the characters in the code below. Yahoo receives the email but doesn't decode it, what am I doing wrong?

- John

function mail_test()
$email = 'someone@example.com';
$subject = 'Test Quoted Printable Email';
$body = quoted_printable_encode('a,b,c,d,e,f');
$domain = explode('www.',$_SERVER['SERVER_NAME']);
$headers = 'From: Server <noreply@'.$domain[1].'>\n';
$headers .= 'Reply-to: noreply@'.$domain[1].'\n';
$headers .= 'Content-Type: text/plain; charset=iso-8859-1\n';
$headers .= 'Content-transfer-encoding: Quoted-printable\n';



 1:24 am on Jul 15, 2013 (gmt 0)

try capitalizing the MIME header name:
JAB Creations

 2:44 am on Jul 15, 2013 (gmt 0)

Thanks, tried that but it didn't change anything...

- John

=EF=BF=BD =01 =02 =03 =04 =05 =06 =07 =08 =0B =0C =0E =0F =10 =11 =12 =13 =
=14 =15 =16 =17 =18 =19 =1A =1B =1C =1D =1E =1F ! " # $ % & ' ( ) * + , - .=
/ 0 1 2 3 4 5 6 7 8 9 : ; < =3D > ? @ A B C D E F G H I J K L M N O P Q R =
S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x=
y z { | } ~ =7F =E2=82=AC =E2=80=9A =C6=92 =E2=80=9E =E2=80=A6 =E2=80=
=A0 =E2=80=A1 =CB=86 =E2=80=B0 =C5=A0 =E2=80=B9 =C5=92 =C5=BD =
=E2=80=98 =E2=80=99 =E2=80=9C =E2=80=9D =E2=80=A2 =E2=80=93 =E2=80=94 =
=CB=9C =E2=84=A2 =C5=A1 =E2=80=BA =C5=93 =C5=BE =C5=B8 =C2=A1 =C2=A2 =
=C2=A3 =C2=A4 =C2=A5 =C2=A6 =C2=A7 =C2=A8 =C2=A9 =C2=AA =C2=AB =C2=AC =
=C2=AD =C2=AE =C2=AF =C2=B0 =C2=B1 =C2=B2 =C2=B3 =C2=B4 =C2=B5 =C2=B6 =
=C2=B7 =C2=B8 =C2=B9 =C2=BA =C2=BB =C2=BC =C2=BD =C2=BE =C2=BF =C3=80 =
=C3=81 =C3=82 =C3=83 =C3=84 =C3=85 =C3=86 =C3=87 =C3=88 =C3=89 =C3=8A =
=C3=8B =C3=8C =C3=8D =C3=8E =C3=8F =C3=90 =C3=91 =C3=92 =C3=93 =C3=94 =
=C3=95 =C3=96 =C3=97 =C3=98 =C3=99 =C3=9A =C3=9B =C3=9C =C3=9D =C3=9E =
=C3=9F =C3=A0 =C3=A1 =C3=A2 =C3=A3 =C3=A4 =C3=A5 =C3=A6 =C3=A7 =C3=A8 =
=C3=A9 =C3=AA =C3=AB =C3=AC =C3=AD =C3=AE =C3=AF =C3=B0 =C3=B1 =C3=B2 =
=C3=B3 =C3=B4 =C3=B5 =C3=B6 =C3=B7 =C3=B8 =C3=B9 =C3=BA =C3=BB =C3=BC =
=C3=BD =C3=BE =C3=BF


 8:05 am on Jul 15, 2013 (gmt 0)

What you have there as data is not ISO-LATIN-1 encoded as quoted-printable.

ISO-LATIN-1 has only 1 byte sequences.

On first looks it's UTF-8 ...

JAB Creations

 1:46 am on Jul 19, 2013 (gmt 0)

There is a chance this will break the page and annoy one of the admins, my apologies in advance...at least there will be some conversion code readily available. ;)

HP's utf8_encode() does not work so I have basically done the following when the charset is declared as iso-8859-1 but the characters haven't been properly encoded/decoded.

- John

else if ($encoding==4)
if ($charset=='iso-8859-1')
$find = array('=A0','=A1','=A2','=A3','=A4','=A5','=A6','=A7','=A8','=A9','=AA','=AB','=AC','=AD','=AE','=AF',
$replace = array(' ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','­','®','¯',
$b = str_ireplace($find,$replace,$b);

[edited by: phranque at 9:13 am (utc) on Jul 19, 2013]
[edit reason] fix sidescroll [/edit]


 6:11 am on Jul 19, 2013 (gmt 0)

Aside of utf8_encode en utf8_decode, there is also mb_convert_encoding and iconv to convert encodings.
I've used mb_convert_encoding in the past.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved