function test_unquote_base64_body() { $msg = <<<EOF From: me@example.com Subject: subject Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: base64 VGhlIGJvZHk= EOF; $Mail = AkMailBase::parse($msg); $this->assertEqual("The body", $Mail->body); $this->assertEqual("VGhlIGJvZHk=", $Mail->getBody()); }
/** * Receives a raw email, parses it into an email object, decodes it, * instantiates a new mailer, and passes the email object to the mailer * object's #receive method. If you want your mailer to be able to * process incoming messages, you'll need to implement a #receive * method that accepts the email object as a parameter and then call * the AkActionMailer::recieve method using "parent::recieve($Message);" * * * class MyMailer extends AkActionMailer{ * public function receive($Message){ * parent::receive($Message); * ... * } * } */ public function &receive($raw_mail) { $this->Message =& AkMailBase::parse($raw_mail); return $this->Message; }
public function test_email_with_partially_quoted_subject() { $Mail = AkMailBase::parse(file_get_contents(AkConfig::getDir('fixtures') . DS . 'raw_email_with_partially_quoted_subject')); $this->assertEqual("Re: Test: \"漢字\" mid \"漢字\" tail", $Mail->subject); }