/** * Plain quoted-printable message. */ public function testQuotedPrintable() { $this->Mail->Body = 'Here is the main body'; $this->Mail->Subject .= ': Plain + Quoted-printable'; $this->Mail->Encoding = 'quoted-printable'; $this->buildBody(); $this->assertTrue($this->Mail->send(), $this->Mail->ErrorInfo); //Check that a quoted printable encode and decode results in the same as went in $t = file_get_contents(__FILE__); //Use this file as test content $this->assertEquals($t, quoted_printable_decode($this->Mail->encodeQP($t)), 'Quoted-Printable encoding round-trip failed'); $this->assertEquals($this->Mail->encodeQP($t), $this->Mail->encodeQPphp($t), 'Quoted-Printable BC wrapper failed'); }
/** * Plain quoted-printable message. */ public function testQuotedPrintable() { $this->Mail->Body = 'Here is the main body'; $this->Mail->Subject .= ': Plain + Quoted-printable'; $this->Mail->Encoding = 'quoted-printable'; $this->buildBody(); $this->assertTrue($this->Mail->send(), $this->Mail->ErrorInfo); //Check that a quoted printable encode and decode results in the same as went in $t = file_get_contents(__FILE__); //Use this file as test content //Force line breaks to UNIX-style $t = str_replace(array("\r\n", "\r"), "\n", $t); $this->assertEquals($t, quoted_printable_decode($this->Mail->encodeQP($t)), 'Quoted-Printable encoding round-trip failed'); $this->assertEquals($this->Mail->encodeQP($t), $this->Mail->encodeQPphp($t), 'Quoted-Printable BC wrapper failed'); //Force line breaks to Windows-style $t = str_replace("\n", "\r\n", $t); $this->assertEquals($t, quoted_printable_decode($this->Mail->encodeQP($t)), 'Quoted-Printable encoding round-trip failed (Windows line breaks)'); }