/** * Test address escaping */ function test_AddressEscaping() { $this->Mail->Subject .= ': Address escaping'; $this->Mail->ClearAddresses(); $this->Mail->AddAddress('*****@*****.**', 'Tim "The Book" O\'Reilly'); $this->Mail->Body = 'Test correct escaping of quotes in addresses.'; $this->BuildBody(); $this->Mail->PreSend(); $b = $this->Mail->GetSentMIMEMessage(); $this->assertTrue(strpos($b, 'To: "Tim \\"The Book\\" O\'Reilly" <*****@*****.**>') !== false); }
public function PreSend() { try { return parent::PreSend(); } catch (phpmailerException $e) { $this->SetError($e->getMessage()); if ($this->exceptions) { throw $e; } return false; } }
protected function PreSend() { //check to see if message body is empty if (empty($this->Body)) { //PHPMailer will throw an error if the body is empty, so insert a blank space if body is empty $this->Body = " "; } return parent::PreSend(); }