0
votes

Using php & Gmail api client to get a gmail message and then reply to the message. Looking at the headers, there is no in-reply-to.

Here is my code:

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

Here are the headers that I get back... Nowhere in the array is the actually reply to address. How do I know how to, or even respond to this message using the API if the headers don't supply the In-Reply-To header?

Array ( [0] => Array ( [name] => Delivered-To [value] => [email protected] )

[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 [email protected] designates xx.xx.xx.xx as permitted sender) [email protected]
    )

[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 [email protected] 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 [email protected] designates xx.xx.xx.xx as permitted sender) [email protected]
    )

[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

1 Answers

0
votes

The Reply-To: email header is not required.

If it is not present, most email clients fall back to the From: header to use as the reply-to email address.