Gmail API未在标题中回复地址 - 无法回复

时间:2017-11-21 02:22:28

标签: php email gmail-api google-api-php-client

使用php& Gmail api客户端获取Gmail邮件然后回复邮件。查看标题,没有回复。

这是我的代码:

$service = new \Google_Service_Gmail($client);
$message = $service->users_messages->get("me", $messageId);
$messagePayload = $message->getPayload();
$headers = $message->getPayload()->getHeaders();

以下是我收到的标题......数组中的无处是实际回复地址。如果标头不提供In-Reply-To标头,我如何知道如何使用API​​或甚至响应此消息?

阵 (     [0] =>排列         (             [name] =>送到了(送去了             [value] => my-emaili-address@gmail.com         )

[1] => Array
    (
        [name] => Received
        [value] => by 10.157.39.46 with SMTP id xxxxxxxx;        Mon, 20 Nov 2017 15:59:44 -0800 (PST)
    )

[2] => Array
    (
        [name] => X-Google-Smtp-Source
        [value] => [this was a long encoded string]
    )

[3] => Array
    (
        [name] => X-Received
        [value] => by xx.xx.xx.xx with SMTP id [an id];        Mon, 20 Nov 2017 15:59:44 -0800 (PST)
    )

[4] => Array
    (
        [name] => ARC-Seal
        [value] => [this was a long encoded string]
    )

[5] => Array
    (
        [name] => ARC-Message-Signature
        [value] => [this was a long encoded string]
    )

[6] => Array
    (
        [name] => ARC-Authentication-Results
        [value] => i=1; mx.google.com;       spf=pass (google.com: domain of xxx@xxxx.com designates xx.xx.xx.xx as permitted sender) smtp.mailfrom=xxx@xxxx.com
    )

[7] => Array
    (
        [name] => Return-Path
        [value] => 
    )

[8] => Array
    (
        [name] => Received
        [value] => from www.xxxxxx.com (xxxxx.com. [xx.xx.xx.xx])        by mx.google.com with ESMTP id xx.xx.xx.xx        for ;        Mon, 20 Nov 2017 15:59:44 -0800 (PST)
    )

[9] => Array
    (
        [name] => Received-SPF
        [value] => pass (google.com: domain of xxx@xxxxxxx.com designates xx.xx.xx.xx as permitted sender) client-ip=xx.xx.xx.xx;
    )

[10] => Array
    (
        [name] => Authentication-Results
        [value] => mx.google.com;       spf=pass (google.com: domain of xxxx@xxxxxxxxx.com designates xx.xx.xx.xx as permitted sender) smtp.mailfrom=xxx@xxxxx.com
    )

[11] => Array
    (
        [name] => Received
        [value] => from www (localhost [xx.xx.xx.xx]) by www.xxxxx.com (Postfix) with ESMTP id xxxxxxxx for ; Mon, 20 Nov 2017 16:59:44 -0700 (MST)
    )

[12] => Array
    (
        [name] => Message-ID
        [value] => <xxxxxxx.JavaMail.root@www>
    )

[13] => Array
    (
        [name] => From
        [value] => xxxxxxxx 
    )

[14] => Array
    (
        [name] => Mime-Version
        [value] => 1.0
    )

[15] => Array
    (
        [name] => Content-Type
        [value] => multipart/mixed; boundary="----=_Part_xxxxxxxxxx"
    )

[16] => Array
    (
        [name] => To
        [value] => xxxx xxxxxxxx 
    )

[17] => Array
    (
        [name] => Subject
        [value] => xxxxxx
    )

[18] => Array
    (
        [name] => Date
        [value] => Mon, 20 Nov 2017 16:59:44 -0700 (MST)
    )

1 个答案:

答案 0 :(得分:0)

不需要Reply-To:电子邮件标头。

如果不存在,大多数电子邮件客户端都会回退到From:标题,以用作回复电子邮件地址。