In this activity, we will be creating an e-mail form making use of Zend's mailing capabilities:
Create a simple e-mail form with input fields for subject, message content, and addressee.
Set up a new controller to display the form and write the necessary views.
Modify the controller so that it references the
Zend\Mail
namespace.use Zend\Mail;
Create a new controller method that does the actual e-mailing; this can be placed within our group chat controller (
CommunicationApp/module/Users/src/Users/Controller/GroupChatController.php
) using the following code:protected function sendOfflineMessage($msgSubj, $msgText, $fromUserId, $toUserId) { $userTable = $this->getServiceLocator() ->get('UserTable'); $fromUser = $userTable->getUser($fromUserId); $toUser = $userTable->getUser($toUserId); $mail = new Mail\Message(); $mail->setFrom($fromUser->email, $fromUser->...