【发布时间】:2020-09-28 17:40:26
【问题描述】:
在有人填写我们网站上的表格后,我正在尝试使用 AlexaCRM php-crm 工具包在 Dynamics 365 中使用 php 创建电子邮件。 电子邮件也出现在 Dynamics 中,但 from 和 to 字段为空。电子邮件本身和主题都存储在 Dynamics 中。
有没有人遇到同样的问题或者有谁知道我做错了什么?
这是我正在使用的代码。
<?php
require_once '../vendor/autoload.php';
use AlexaCRM\CRMToolkit\Client as OrganizationService;
use AlexaCRM\CRMToolkit\Settings;
use AlexaCRM\CRMToolkit\Client;
use AlexaCRM\CRMToolkit\Entity\MetadataCollection;
use AlexaCRM\CRMToolkit\Entity\EntityReference;
$options = [
'serverUrl' => 'xxx.dynamics.com',
'username' => 'xxx@xxx.com',
'password' => 'xxxxxx',
'authMode' => 'OnlineFederation',
];
$serviceSettings = new Settings( $options );
$service = new OrganizationService( $serviceSettings );
$email = $service->entity( 'email' );
$email->subject = 'TEST SUBJECT';
$email->description = 'TEST EMAIL';
$email->sender = 'Sender Name';
$email->from = 'test@gmail.com';
$email->to = 'Our Company';
$email->torecipients = 'test@ourcompany.com';
$emailId = $email->create();
?>
【问题讨论】:
标签: php email dynamics-365