Using PHP-EWS (GarethP), I am attempting to setReplyTo like this:
use garethp\ews\API\Type;
use garethp\ews\MailAPI;
$api = MailAPI::withUsernameAndPassword("host", "username", "password");
$message = new Type\MessageType();
$message->setSubject("Some Subject");
$message->setBody("Test Email");
$message->setToRecipients("[email protected]");
$message->setReplyTo("[email protected]"); // <-- this is the 'ReplyTo' address I want to set.
$api->sendMail($message);
But this does not have any affect, and the recipient is then replying to the sender/from address.
The Api callback shows:
'replyTo' => NULL,
Any ideas on how solve?
Ah, I figured it out. For anyone else experiencing a similar issue, here is what I found.
Within the
MessageType.phpfile, theaddReplyToandsetReplyTofunctions are missing.Adding these in the same way as the
setToRecipients,setCcRecipientsandsetBccRecipientsfunctions solves the problem: