Form E-mail not being send

Permalink
When filling in the form in Concrete (8.1.0) is says that it was successful and is being send. I don't get any e-mails. View log for error (get 2 logs: first the error en secondly that it is being send, which is not the case)

Mail uitzondering is opgetreden. Niet in staat om mail te verzenden:Unable to send mail: Unknown error
#0 [internal function]: Zend\Mail\Transport\Sendmail->mailHandler('info@financieel...', '=?UTF-8?Q?Websi...', 'Het formulier C...', 'Date: Fri, 14 A...', ' -fmaarten@vorm...')
#1 /sites/#########.nl/www/concrete/vendor/zendframework/zend-mail/src/Transport/Sendmail.php(138): call_user_func(Array, 'info@#########...', '=?UTF-8?Q?Websi...', 'Het formulier C...', 'Date: Fri, 14 A...', ' -fmaarten@#########...')
#2 /sites/#########.nl/www/concrete/src/Mail/Service.php(502): Zend\Mail\Transport\Sendmail->send(Object(Zend\Mail\Message))
#3 /sites/#########.nl/www/concrete/blocks/express_form/controller.php(196): Concrete\Core\Mail\Service->sendMail()
#4 [internal function]: Concrete\Block\ExpressForm\Controller->action_submit('309')
#5 /sites/#########.nl/www/concrete/src/Controller/AbstractController.php(172): call_user_func_array(Array, Array)
#6 /sites/#########.nl/www/concrete/src/Page/Controller/PageController.php(312): Concrete\Core\Controller\AbstractController->runAction('action_submit', Array)
#7 /sites/#########.nl/www/concrete/src/Http/ResponseFactory.php(178): Concrete\Core\Page\Controller\PageController->validateRequest()
#8 /sites/#########.nl/www/concrete/src/Http/ResponseFactory.php(372): Concrete\Core\Http\ResponseFactory->controller(Object(Concrete\Core\Page\Controller\PageController))
#9 /sites/#########.nl/www/concrete/src/Routing/DispatcherRouteCallback.php(41): Concrete\Core\Http\ResponseFactory->collection(Object(Concrete\Core\Page\Page))
#10 /sites/#########.nl/www/concrete/src/Http/DefaultDispatcher.php(115): Concrete\Core\Routing\DispatcherRouteCallback->execute(Object(Concrete\Core\Http\Request))
#11 /sites/#########.nl/www/concrete/src/Http/DefaultDispatcher.php(53): Concrete\Core\Http\DefaultDispatcher->handleDispatch(Object(Concrete\Core\Http\Request))
#12 /sites/#########.nl/www/concrete/src/Http/Middleware/DispatcherDelegate.php(39): Concrete\Core\Http\DefaultDispatcher->dispatch(Object(Concrete\Core\Http\Request))
#13 /sites/#########.nl/www/concrete/src/Http/Middleware/ThumbnailMiddleware.php(61): Concrete\Core\Http\Middleware\DispatcherDelegate->next(Object(Concrete\Core\Http\Request))

 
ob7dev replied on at Permalink Reply
ob7dev
Most likely its because the servers php mailer isn't working right.

I suggest enabling SMTP and routing it through a relay.
Otherwise even the php mailers successful emails often end up in spam.
jlgrall replied on at Permalink Reply
I have the same problem. (Concrete5 8.1.0, Form block, using the Default PHP Mail Function)

I noticed that it doesn't use the correct email address. In the error log I can see that the "From" and "Reply-To" headers are set to the mail address of the admin user, which is wrong. The "From" should be the email defined in the form's "Options > Send form submissions to email addresses", and the "Reply-To" should be the email given by the person filling the form.

I think that the relevant code is in: "concrete/blocks/express_form/controller.php" lines 165-183.
Could also be something in: "concrete/src/Mail/Service.php".

Edit: the problem with not using the correct "From" address is that the mail will be rejected as spam, because it is not an allowed server for that particular address.
jlgrall replied on at Permalink Reply
Yep, in "concrete/blocks/express_form/controller.php" lines 166-167:
it tries to take the email address from: \Config::get('concrete.email.form_block.address')
But I don't know where to configure this "concrete.email.form_block.address" property. I found nothing in the Concrete5 System & Settings. And I didn't find anything related in the "application/config" folder.

Edit: I found where to configure the property. It is in the /application/config/concrete.php file. More infos:
-https://www.concrete5.org/community/forums/usage/changing-admin-emai...
- (Also:https://www.concrete5.org/community/forums/customizing_c5/email-test...