public function testSendMailToMultipleRecipients() { $to = "user@example.com, Another User <*****@*****.**>"; $cc = "user2@example.com, user3@example.com"; $bcc = "User 4 <*****@*****.**>"; $reply_to = "User5 <*****@*****.**"; $headers = "From: foo@foo.com\r\n" . "Cc: {$cc}\r\n" . "Bcc: {$bcc}\r\n" . "Reply-To: {$reply_to}\r\n"; $message_proto = new MailMessage(); $message_proto->setSender('*****@*****.**'); $message_proto->addTo($to); $message_proto->addCc($cc); $message_proto->addBcc($bcc); $message_proto->setReplyTo($reply_to); $message_proto->setSubject('subject'); $message_proto->setTextBody('text'); $response = new VoidProto(); $this->apiProxyMock->expectCall('mail', 'Send', $message_proto, $response); $ret = Mail::sendMail($to, 'subject', 'text', $headers); $this->assertTrue($ret); $this->apiProxyMock->verify(); }