Delivery Failure Form

Permalink
Mail is not being delivered to our client (using office 365). And test mail is being successfully send but also not delivered (multiple test to different domeins).

Recipient: [SMTP:info@xxxx.xx]
Reason: 550 Messages should have one or no Subject headers, not 2.


Received: from ([127.0.0.1]) with MailEnable ESMTP; Mon, 31 Dec 2018 17:10:15 +0100
Subject: =?UTF-8?Q?Website=20Form=20Submission=20=E2=80=93=20Contactformulier?=
Date: Mon, 31 Dec 2018 17:10:15 +0100
Reply-To: info@xxx.xx
From: info@xxx.xx
Subject: =?UTF-8?Q?Website=20Form=20Submission=20=E2=80=93=20Contactformulier?=
To: info@xxx.xx
Message-ID: <542dfa02917dsf82c4dsf9142d4df58232313d0a7xca7@www.xxx.xx>
MIME-Version: 1.0
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-ME-Bayesian: 0.000000
form info


So the mail does not being send to the info@ adress but the webserver sends a NDR to the same adress?

Any idea's what the problem is and where to fix it?

 
mnakalay replied on at Permalink Reply
mnakalay
it says so in the message "Messages should have one or no Subject headers, not 2."

And in the message header, you can see "subject" appearing twice. What form block are you using?
studio4graphics replied on at Permalink Reply
Yes I saw that, but I use the standard express form block.
So I thought that could not be the problem.
mnakalay replied on at Permalink Reply
mnakalay
The Standard Express form wouldn't do that.

Are you sure you didn't override the block's controller somewhere?

What version of C5 are you using?
mnakalay replied on at Permalink Reply
mnakalay
Sorry, ignore my previous message. I Think I know what the problem is and how to fix it.

Make a copy of the file concrete/mail/block_express_form_submission.php and put it in application/mail on your server.

Then modify your copy and remove the line
$subject = t('Website Form Submission – %s', $formName);

The subject is already set in code and this line here is most likely responsible for the double subject. Removing it should fix the problem.

And C5 will first look for your override before trying to use its own email template.
studio4graphics replied on at Permalink Reply
Updated from 8.1 to 8.2.1.

In the block_express_form_submission.php there is no $subject.
Also when I try to test the Default PHP Mail fuction. It says it has succesfully send a test-message. But I get no e-mail (other domein). Thats why I thought it may have nothing to do with the formblock.

<?php
defined('C5_EXECUTE') or die("Access Denied.");
$formDisplayUrl = URL::to('/dashboard/reports/forms', 'view', $entity->getEntityResultsNodeId());
$submittedData = '';
foreach($attributes as $value) {
    $submittedData .= $value->getAttributeKey()->getAttributeKeyDisplayName() . ":\r\n";
    $submittedData .= $value->getPlainTextValue() . "\r\n\r\n";
}
$body = t("
There has been a submission of the form %s through your concrete5 website.
%s
To view all of this form's submissions, visit %s 
", $formName, $submittedData, $formDisplayUrl);
mnakalay replied on at Permalink Reply
mnakalay
This is weird. In 8.4.3 that $subject variable is there and it would explain the problem.

Did you check if you didn't already have an email template override in application/mail? Maybe there is one and it has a $subject variable?

The error about the double subject could be an error sent back by the receiver's email server, I'm not sure but it's a possibility.
studio4graphics replied on at Permalink Reply
No I have nothing in applications/mail. It is empty. I now installed the lates version of concrete5.

Deleted forms en custom form block. Then added new form block but then I get an error:
include(D:\appdata\IIS\vhosts\xxxxxxx.xx\httpdocs/application/blocks/express_form/view.php): failed to open stream: No such file or directory

This is really weird. I have no idea why it needs the view.php. It should pick the "updates/concrete5-8.4.3/concrete/blocks/express_form/view.php"?

When I place the view.php the form show (and in the log I can see the form result). But the email does not get delivered. So I'm really confused where the problem is.

Thanks for your time!