Automatic answer to Gmail email from specific sender

Hi !

There is an error with my Make scenario that I don’t understand.

The goal is to automatically reply to emails from my website lead forms. Since they come from a specific email address, I filtered the emails by sender, so only those are replied to.

The problem is that I get the error “- Invalid email address in parameter ‘to’.”

However, I can see that the email address fetched by the scenario (from my test) seems to be ok. Here are some screenshots.

Thanks!
Yohan



Capture d’écran, le 2024-07-23 à 11.46.40

That doesn’t look like a valid email address by itself.

Could you provide the output bundle?

Please provide the output bundle of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

samliewrequest private consultation

Join the unofficial Make Discord server to chat with us!

This is the output bundle of my Gmail “Watch Emails” module. For the “Send an Email” module, the operation contains no data (0) so there is nothing in the output bundle.

[
    {
        "date": "2024-07-23T15:33:12.000Z",
        "id": 31936,
        "size": 6103,
        "labels": [
            "Lead Bonzai",
            "\\Important",
            "\\Inbox"
        ],
        "xGmMsgid": "1805384462448518362",
        "messageId": "190e039a6f40e4da",
        "threadId": "190e039a6f40e4da",
        "messageLink": "https://mail.google.com/mail/u/0/#inbox/190e039a6f40e4da",
        "attachments": [],
        "headers": {
            "received": [
                "by 2002:a05:7108:5509:b0:3a2:9d6d:ca14 with SMTP id ay9csp1685187gdb; Tue, 23 Jul 2024 08:33:13 -0700 (PDT)",
                "from aqua.yew.relay.mailchannels.net (aqua.yew.relay.mailchannels.net. [23.83.220.5]) by mx.google.com with ESMTPS id 41be03b00d2f7-7a198a9b70asi6127852a12.225.2024.07.23.08.33.12 for <info@bonzaimarketing.ca> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 08:33:12 -0700 (PDT)",
                "from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 741BD904E55 for <info@bonzaimarketing.ca>; Tue, 23 Jul 2024 15:33:11 +0000 (UTC)",
                "from srv1384.main-hosting.eu (unknown [127.0.0.6]) (Authenticated sender: hostingershared) by relay.mailchannels.net (Postfix) with ESMTPA id 17141904703 for <info@bonzaimarketing.ca>; Tue, 23 Jul 2024 15:33:11 +0000 (UTC)",
                "from srv1384.main-hosting.eu ([UNAVAILABLE]. [82.197.82.23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.98.30.147 (trex/7.0.2); Tue, 23 Jul 2024 15:33:11 +0000",
                "from u144885201 by srv1384.main-hosting.eu with local (Exim 4.97.1) (envelope-from <u144885201@srv1384.main-hosting.eu>) id 1sWHVm-0000000CoYI-0Wjv for info@bonzaimarketing.ca; Tue, 23 Jul 2024 15:33:10 +0000"
            ],
            "deliveredTo": "info@bonzaimarketing.ca",
            "xOriginalFrom": null,
            "replyTo": "\"\\\"yohan_robert@hotmail.com\\\"\" <yohan_robert@hotmail.com>",
            "messageId": "<oXLwsaKE1G7uMqfyvM6SxYfN3WdM3HVuU8qdMi4Lo@bonzaimarketing.ca>"
        },
        "headersList": [
            {
                "key": "delivered-to",
                "value": "info@bonzaimarketing.ca"
            },
            {
                "key": "received",
                "value": [
                    "by 2002:a05:7108:5509:b0:3a2:9d6d:ca14 with SMTP id ay9csp1685187gdb; Tue, 23 Jul 2024 08:33:13 -0700 (PDT)",
                    "from aqua.yew.relay.mailchannels.net (aqua.yew.relay.mailchannels.net. [23.83.220.5]) by mx.google.com with ESMTPS id 41be03b00d2f7-7a198a9b70asi6127852a12.225.2024.07.23.08.33.12 for <info@bonzaimarketing.ca> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 08:33:12 -0700 (PDT)",
                    "from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 741BD904E55 for <info@bonzaimarketing.ca>; Tue, 23 Jul 2024 15:33:11 +0000 (UTC)",
                    "from srv1384.main-hosting.eu (unknown [127.0.0.6]) (Authenticated sender: hostingershared) by relay.mailchannels.net (Postfix) with ESMTPA id 17141904703 for <info@bonzaimarketing.ca>; Tue, 23 Jul 2024 15:33:11 +0000 (UTC)",
                    "from srv1384.main-hosting.eu ([UNAVAILABLE]. [82.197.82.23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.98.30.147 (trex/7.0.2); Tue, 23 Jul 2024 15:33:11 +0000",
                    "from u144885201 by srv1384.main-hosting.eu with local (Exim 4.97.1) (envelope-from <u144885201@srv1384.main-hosting.eu>) id 1sWHVm-0000000CoYI-0Wjv for info@bonzaimarketing.ca; Tue, 23 Jul 2024 15:33:10 +0000"
                ]
            },
            {
                "key": "x-google-smtp-source",
                "value": "AGHT+IFSBySMOghyMHXF1HLs0ndd4eorHDWBmhI33JQkJUN5BXbio3yD2N64JAqp//SgPi3g6xro"
            },
            {
                "key": "x-received",
                "value": "by 2002:a05:6a21:6da6:b0:1c2:8d91:634 with SMTP id adf61e73a8af0-1c422997ab3mr15259666637.45.1721748792885; Tue, 23 Jul 2024 08:33:12 -0700 (PDT)"
            },
            {
                "key": "arc-seal",
                "value": [
                    [
                        "i=2; a=rsa-sha256; t=1721748792; cv=pass; d=google.com; s=arc-20160816; b=WZfbJTuvInOv8OIS8sbSuSPMROJiByFAjuATYvzTQT8J93Mwtd+H+fN/yrt7+hDEPe JJ8I6D5N4/F0frbYblnT1KMlEpcRe1pn6BdxzfurrRxsHa2QbKpNFk6AWUxCwRCqsU5V IErM1AdA9pQt3XlG6OpIau39khH9VaSgkeR6FBxM4Kf38jedE1E4ZUI5HTSo140w0eot a1MUo6av7h7PRnqPqeZzxaWhls6FqJXQwDivOYJHU70508Yga4Up+2F37eGNxI/uYy7Y RvFOjYbSPhrncsNKfOLlRkLYPQYP/IqCMMN4yJhvP3RYnul/FqIPEpVMOMxnAYsBHauu QsGw==",
                        "i=1; s=arc-2022; d=mailchannels.net; t=1721748791; a=rsa-sha256; cv=none; b=pRRA2NEYm+jbkrHcTPqIwLmjQN8XzXMy8DDvDMj0oG7o1LTKH2Fse1aFA+y0FY9ruNHDZG Nty2/U5EPku60p+PtCHTvsRLObrWxp5Q7+/PmR6QrdbgA02bbeKZRhJHrU0GP/qsETkGrl 6pzuqXUUFeSNvx136YBlLydwWLsEpNCHrbUe9dPMcWpXJgqosvKdjklZSbEyS+SM54K4y7 8MSQgrkuDH9Rm7/Bv0odC7zuZFTO6OwwXTuBqEMwagHOqFOWnAp8Dhyw3UZosq+n2RPpHj ENIpGE8ekHUwm5yZ/hdbGxV1QKDGzFqAUBmDlBGo9Qae2ltdFiFEBUHT51dRfA=="
                    ],
                    [
                        "i=2; a=rsa-sha256; t=1721748792; cv=pass; d=google.com; s=arc-20160816; b=WZfbJTuvInOv8OIS8sbSuSPMROJiByFAjuATYvzTQT8J93Mwtd+H+fN/yrt7+hDEPe JJ8I6D5N4/F0frbYblnT1KMlEpcRe1pn6BdxzfurrRxsHa2QbKpNFk6AWUxCwRCqsU5V IErM1AdA9pQt3XlG6OpIau39khH9VaSgkeR6FBxM4Kf38jedE1E4ZUI5HTSo140w0eot a1MUo6av7h7PRnqPqeZzxaWhls6FqJXQwDivOYJHU70508Yga4Up+2F37eGNxI/uYy7Y RvFOjYbSPhrncsNKfOLlRkLYPQYP/IqCMMN4yJhvP3RYnul/FqIPEpVMOMxnAYsBHauu QsGw==",
                        "i=1; s=arc-2022; d=mailchannels.net; t=1721748791; a=rsa-sha256; cv=none; b=pRRA2NEYm+jbkrHcTPqIwLmjQN8XzXMy8DDvDMj0oG7o1LTKH2Fse1aFA+y0FY9ruNHDZG Nty2/U5EPku60p+PtCHTvsRLObrWxp5Q7+/PmR6QrdbgA02bbeKZRhJHrU0GP/qsETkGrl 6pzuqXUUFeSNvx136YBlLydwWLsEpNCHrbUe9dPMcWpXJgqosvKdjklZSbEyS+SM54K4y7 8MSQgrkuDH9Rm7/Bv0odC7zuZFTO6OwwXTuBqEMwagHOqFOWnAp8Dhyw3UZosq+n2RPpHj ENIpGE8ekHUwm5yZ/hdbGxV1QKDGzFqAUBmDlBGo9Qae2ltdFiFEBUHT51dRfA=="
                    ]
                ]
            },
            {
                "key": "arc-message-signature",
                "value": [
                    [
                        "i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:content-transfer-encoding:mime-version:message-id:reply-to :from:date:subject:to; bh=eEcOF2D4XFVHz2zxEZNKNAvo35YK8ZGLxBZn/ZwqNJc=; fh=yQ5ZeTPgpQYEwcNpDUJ2lmbTwn/RD5TdDoP7MchpAvc=; b=mRokL3sThdR/pqGeq96F2GTABG+btXsS6weiOrPoboDHXhNyS5zsDSXTOUQoFu5m83 m56+M61sRZiL5EkhqqMj2r9EMiF0h6Hn29GQOBapSZHZ+jAELpFN2u/uzILuc9KGh4ro lbx+2X4m0QHO+9KRlVED0F/+JMp7c/M0CUh5fBDZSxlWoRGvpz1LRFbBDRphk7dTKZzf afLnMQdlSEeTdIS2Z7hyxhPxC+fhhNO6zioCCpbuabd7isDwDeZdKALRG4Hosf5U4wdm LhF7B7we0JXIkPWACZYLOYcAfCKhMjqXSHU4SBP4BDxyfP2AaZistK2jsh7wjJNcbFO9 lSPA==; dara=google.com",
                        "i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1721748791; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eEcOF2D4XFVHz2zxEZNKNAvo35YK8ZGLxBZn/ZwqNJc=; b=WXjcRplLuoCgBYQBfGkvzbKayM86wMLQJxdCvd+4XLt7dCrhcGm64pz2ZDhh//eMPYhcTE Kv158oM3FqUWA4qGiaYWxNa/ypQqvCLp62psMHNzboDnIbiQZJVVSNtmoWpt1gYmMw9VW7 aIfcofq5B6eE47yhNVaNnHbJmskQ29qlYUaA9/jOyxMoPJI9tgfUncOkh2qZmFx05h/mh7 0WdoaZQGuKuJ9ce++nhZ0R+Y6KpDXoC/HYC3W1xESCiyYrNTwc2himHrcZDfCs6fPRiL02 aqKQLnAPoaLoTkorHPEPQyunYbG8uKUsZPuZTArfwvyAiCVLHONyVSbZyntvnw=="
                    ],
                    [
                        "i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:content-transfer-encoding:mime-version:message-id:reply-to :from:date:subject:to; bh=eEcOF2D4XFVHz2zxEZNKNAvo35YK8ZGLxBZn/ZwqNJc=; fh=yQ5ZeTPgpQYEwcNpDUJ2lmbTwn/RD5TdDoP7MchpAvc=; b=mRokL3sThdR/pqGeq96F2GTABG+btXsS6weiOrPoboDHXhNyS5zsDSXTOUQoFu5m83 m56+M61sRZiL5EkhqqMj2r9EMiF0h6Hn29GQOBapSZHZ+jAELpFN2u/uzILuc9KGh4ro lbx+2X4m0QHO+9KRlVED0F/+JMp7c/M0CUh5fBDZSxlWoRGvpz1LRFbBDRphk7dTKZzf afLnMQdlSEeTdIS2Z7hyxhPxC+fhhNO6zioCCpbuabd7isDwDeZdKALRG4Hosf5U4wdm LhF7B7we0JXIkPWACZYLOYcAfCKhMjqXSHU4SBP4BDxyfP2AaZistK2jsh7wjJNcbFO9 lSPA==; dara=google.com",
                        "i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1721748791; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eEcOF2D4XFVHz2zxEZNKNAvo35YK8ZGLxBZn/ZwqNJc=; b=WXjcRplLuoCgBYQBfGkvzbKayM86wMLQJxdCvd+4XLt7dCrhcGm64pz2ZDhh//eMPYhcTE Kv158oM3FqUWA4qGiaYWxNa/ypQqvCLp62psMHNzboDnIbiQZJVVSNtmoWpt1gYmMw9VW7 aIfcofq5B6eE47yhNVaNnHbJmskQ29qlYUaA9/jOyxMoPJI9tgfUncOkh2qZmFx05h/mh7 0WdoaZQGuKuJ9ce++nhZ0R+Y6KpDXoC/HYC3W1xESCiyYrNTwc2himHrcZDfCs6fPRiL02 aqKQLnAPoaLoTkorHPEPQyunYbG8uKUsZPuZTArfwvyAiCVLHONyVSbZyntvnw=="
                    ]
                ]
            },
            {
                "key": "arc-authentication-results",
                "value": [
                    [
                        "i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of u144885201@srv1384.main-hosting.eu designates 23.83.220.5 as permitted sender) smtp.mailfrom=u144885201@srv1384.main-hosting.eu",
                        "i=1; rspamd-587dc898b6-58twx; auth=pass smtp.auth=hostingershared smtp.mailfrom=u144885201@srv1384.main-hosting.eu"
                    ],
                    [
                        "i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of u144885201@srv1384.main-hosting.eu designates 23.83.220.5 as permitted sender) smtp.mailfrom=u144885201@srv1384.main-hosting.eu",
                        "i=1; rspamd-587dc898b6-58twx; auth=pass smtp.auth=hostingershared smtp.mailfrom=u144885201@srv1384.main-hosting.eu"
                    ]
                ]
            },
            {
                "key": "return-path",
                "value": "<u144885201@srv1384.main-hosting.eu>"
            },
            {
                "key": "received-spf",
                "value": "pass (google.com: domain of u144885201@srv1384.main-hosting.eu designates 23.83.220.5 as permitted sender) client-ip=23.83.220.5;"
            },
            {
                "key": "authentication-results",
                "value": "mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of u144885201@srv1384.main-hosting.eu designates 23.83.220.5 as permitted sender) smtp.mailfrom=u144885201@srv1384.main-hosting.eu"
            },
            {
                "key": "x-sender-id",
                "value": [
                    [
                        "hostingershared|x-authuser|u144885201@srv1384.main-hosting.eu",
                        "hostingershared|x-authuser|u144885201@srv1384.main-hosting.eu"
                    ],
                    [
                        "hostingershared|x-authuser|u144885201@srv1384.main-hosting.eu",
                        "hostingershared|x-authuser|u144885201@srv1384.main-hosting.eu"
                    ]
                ]
            },
            {
                "key": "x-mc-relay",
                "value": "Junk"
            },
            {
                "key": "x-mailchannels-senderid",
                "value": "hostingershared|x-authuser|u144885201@srv1384.main-hosting.eu"
            },
            {
                "key": "x-mailchannels-auth-id",
                "value": "hostingershared"
            },
            {
                "key": "x-interest-rock",
                "value": "6f1944e436d55c89_1721748791280_2081740627"
            },
            {
                "key": "x-mc-loop-signature",
                "value": "1721748791280:2541230453"
            },
            {
                "key": "x-mc-ingress-time",
                "value": "1721748791280"
            },
            {
                "key": "to",
                "value": "info@bonzaimarketing.ca"
            },
            {
                "key": "subject",
                "value": "Lead site - test"
            },
            {
                "key": "x-php-originating-script",
                "value": "144885201:PHPMailer.php"
            },
            {
                "key": "date",
                "value": "Tue, 23 Jul 2024 15:33:10 +0000"
            },
            {
                "key": "from",
                "value": "mail@bonzaimarketing.ca"
            },
            {
                "key": "reply-to",
                "value": "\"\\\"yohan_robert@hotmail.com\\\"\" <yohan_robert@hotmail.com>"
            },
            {
                "key": "message-id",
                "value": "<oXLwsaKE1G7uMqfyvM6SxYfN3WdM3HVuU8qdMi4Lo@bonzaimarketing.ca>"
            },
            {
                "key": "x-mailer",
                "value": "PHPMailer 6.9.1 (https://github.com/PHPMailer/PHPMailer)"
            },
            {
                "key": "mime-version",
                "value": "1.0"
            },
            {
                "key": "content-type",
                "value": "text/plain; charset=UTF-8"
            },
            {
                "key": "content-transfer-encoding",
                "value": "8bit"
            },
            {
                "key": "sender",
                "value": "<u144885201@srv1384.main-hosting.eu>"
            },
            {
                "key": "x-authuser",
                "value": "u144885201@srv1384.main-hosting.eu"
            }
        ],
        "from": {
            "address": "mail@bonzaimarketing.ca",
            "name": ""
        },
        "to": [
            {
                "address": "info@bonzaimarketing.ca",
                "name": ""
            }
        ],
        "subject": "Lead site - test",
        "cc": null,
        "bcc": null,
        "text": "Formulaire contact - Footer\n\nNom : test\nEmail : yohan_robert@hotmail.com\nTéléphone : 4506677788\nEntreprise : bonzai\nMessage : test rep auto\n\nSource :\n\n",
        "html": null,
        "references": null,
        "inReplyTo": null,
        "priority": "normal"
    }
]

The full variable contains other things, and you want to get the actual email between the angled brackets,

Screenshot_2024-07-24_090740

So in your email field you want to do something like this to remove everything except the red part:

Screenshot_2024-07-24_090729

You can use the built-in function replace

e.g.:

{{ replace(1.headers.replyTo; "/(?:.*<|>.*)/g"; emptystring) }}

For more information, see the function documentation in the Help Center.

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

4 Likes

Thank you, it’s now working like a charm.

Cheers!
Yohan

No problem, glad I could help!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

4. Do join the unofficial Make Discord server for live chat and video assistance

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!