Mail app is not connecting to mail account; Unexpected error during account creation

SOLVED:

I must to use php-mail to send the emails:

Docu:

Use php-mail for sending mail

You can use the php-mail function to send mails. This is needed for some webhosters (1&1 (1und1)):

‘app.mail.transport’ => ‘php-mail’

In my case for Zoho Mail.

Thank you all :slight_smile:

Could anyone explain why is this needed and what is used instead it by default? Sorry but I am actually learning thanks

Amazing App by the way



Thank you for answering @ChristophWurst. I’ve tried what you say but unfortunately I am having the same issue :confused:

This is what the log says:

{
“reqId”:“qiuH861Mf0LTkRQ9J8t7”,
“level”:1,
“time”:“December 16, 2020 19:13:09”,
“remoteAddr”:“XX.XXX.XX.XXX”,
“user”:“user”,
“app”:“mail”,
“method”:“POST”,
“url”:“/valpol/index.php/apps/mail/api/accounts”,
“message”:“Setting up manually configured account”,
“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:84.0) Gecko/20100101 Firefox/84.0”,
“version”:“20.0.3.2”
}
{
“reqId”:“qiuH861Mf0LTkRQ9J8t7”,
“level”:0,
“time”:“December 16, 2020 19:13:09”,
“remoteAddr”:“XX.XXX.XX.XXX”,
“user”:“user”,
“app”:“mail”,
“method”:“POST”,
“url”:“/valpol/index.php/apps/mail/api/accounts”,
“message”:“Connecting to account myaccount@zohomail.eu”,
“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:84.0) Gecko/20100101 Firefox/84.0”,
“version”:“20.0.3.2”
}
{
“reqId”:“qiuH861Mf0LTkRQ9J8t7”,
“level”:0,
“time”:“December 16, 2020 19:13:11”,
“remoteAddr”:“XX.XXX.XX.XXX”,
“user”:“user”,
“app”:“PHP”,
“meth od”:“POST”,
“url”:“/valpol/index.php/apps/mail/api/accounts”,
“message”:{
“Exception”:“Error”,
“Message”:“stream_socket_client(): unable to connect to ssl://smtp.zoho.eu:465 (Connection timed out) at /home/user/public_html/valpol/apps/mail/vendor/pear-pear.horde.org/Horde_Soc ket_Client/Horde/Socket/Client.php#293”,
“Code”:0,
“Trace”:[{
“function”:“onAll”,
“class”:“OC\Log\ErrorHandler”,
“type”:“::”,
“args”:[2,“stream_socket_client(): unable to connect to ssl://smtp.zoho.eu:465 (Connection timed out)”,
“/home/user/public_html/valpol/apps/mail/vendor/pear-pear.horde.org/Horde_Socket_Client/Horde/Socket/Client.php”,
293,
{
“host”:“smtp.zoho.eu”,
“port”:465,
“timeout”:2,
“secure”:“ssl”,
“context”:{“ssl”{“verify_peer”:true, “verify_peer_name”:true}},
“retries”:0,
“conn”:“ssl://smtp.zoho.eu:465”,
“error_number”:0,
“error_string”:“”
}]},
{“file”:“/home/user/public_html/valpol/apps/mail/vendor/pear-pear.horde.org/Horde_Socket_Client/Horde/Socket/Client.php”,
“line”:293,
“function”:“stream_socket_client”,
“args”:[“ssl://smtp.zoho.eu:465”,0,“”,2,4,null]},
{
“file”:“/home/user/public_html/valpol/apps/mail/vendor/pear-pear.horde.org/Horde_Socket_Client/Horde/Socket/Client.php”,
“line”:106,
“function”:“_connect”,
“class”:“Horde\Socket\Client”,
“type”:“->”,
“args”:[“smtp.zoho.eu”,465,2,“ssl”,{“ssl”:{“verify_peer”:true,“verify_peer_name”:true}}]},{“file”:“/home/user/public_html/valpol/apps/mail/vendor/pear-pear.horde.org/Horde_Smtp/Horde/Smtp.php”,
“line”:379,
“function”:“__construct”,
“class”:“Horde\Socket\Client”,
“type”:“->”,
“args”:[“smtp.zoho.eu”,465,2,“ssl”,{“ssl”:{“verify_peer”:true,“verify_peer_name”:true}},{“debug”:{“active”:true,“class”:“Horde_Smtp_Debug”}}]},
{“file”:“/home/user/public_html/valpol/apps/mail/vendor/pear-pear.horde.org/Horde_Mail/Horde/Mail/Transport/Smtphorde.php”,
“line”:160,
“function”:“login”,
“class”:“Horde_Smtp”,
“type”:“->”,
“args”:[“*** sensitive parameters replaced ***”]},
{
“file”:“/home/user/public_html/valpol/apps/mail/lib/Account.php”,
“line”:233,
“function”:“getSMTPObject”,
“class”:“Horde_Mail_Transport_Smtphorde”,
“type”:“->”,
“args”:
},
{“file”:“/home/user/public_html/valpol/apps/mail/lib/Service/SetupService.php”,
“line”:128,
“function”:“testConnectivity”,
“class”:“OCA\Mail\Account”,
“type”:“->”,
“args”:[{
“send8bit”:false,
“sep”:“\r\n”,
“class”:“Horde_Mail_Transport_Smtphorde”}]},
{“file”:“/home/user/public_html/valpol/apps/mail/lib/Controller/AccountsController.php”,
“line”:328,
“function”:“createNewAccount”,
“class”:“OCA\Mail\Service\SetupService”,
“type”:“->”,
“args”:[
“my_user”,
“myaccount@zohomail.eu”,
“imap.zoho.eu”,
993,
“ssl”,
“myaccount@zohomail.eu”,
“my_password_here”,
“smtp.zoho.eu”,
465,
“ssl”,
“myaccount@zohomail.eu”,
“my_password_here”,
“user”
]},
{
“file”:“/home/user/public_html/valpol/lib/private/AppFramework/Http/Dispatcher.php”,
“line”:169,
“function”:“create”,
“class”:“OCA\Mail\Controller\AccountsController”,
“type”:“->”,
“args”:[
“my_user”,“myaccount@zohomail.eu”,
null,
“imap.zoho.eu”,
993,
“ssl”,
“myaccount@zohomail.eu”,
“my_password”,
“smtp.zoho.eu”,
465,
“ssl”,
“myaccount@zohomail.eu”,
“my_password”,
false
]},
{
“file”:“/home/user/public_html/valpol/lib/private/AppFramework/Http/Dispatcher.php”,
“line”:100,
“function”:“executeController”,
“class”:“OC\AppFramework\Http\Dispatcher”,
“type”:“->”,
“args”:[{
“class”:“OCA\Mail\Controller\AccountsController”},
“create”
]},
{
“file”:“/home/user/public_html/valpol/lib/private/AppFramework/App.php”,
“line”:152,
“function”:“dispatch”,
“class”:“OC\AppFramework\Http\Dispatcher”,
“type”:“->”,
“args”:[{“class”:“OCA\Mail\Controller\AccountsController”},
“create”]},
{
“file”:“/home/user/public_html/valpol/lib/private/Route/Router.php”,
“line”:308,
“function”:“main”,
“class”:“OC\AppFramework\App”,
“type”:“::”,
“args”:[
“OCA\Mail\Controller\AccountsController”,
“create”,
{
“class”:“OC\AppFramework\DependencyInjection\DIContainer”
},
{
“action”:null,
“_route”:“mail.accounts.create”
}
]
},
{
“file”:“/home/user/public_html/valpol/lib/base.php”,
“line”:1008,
“function”:“match”,
“class”:“OC\Route\Router”,
“type”:“->”,
“args”:[“/apps/mail/api/accounts”]
},
{
“file”:“/home/user/public_html/valpol/index.php”,
“line”:37,
“function”:“handleRequest”,
“class”:“OC”,
“type”:“::”,
“args”:
}
],
“File”:“/home/user/public_html/valpol/lib/private/Log/ErrorHandler.php”,
“Line”:98,
“CustomMessage”:“–”
},
“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:84.0) Gecko/20100101 Firefox/84.0”,
“version”:“20.0.3.2”
}
{
“reqId”:“qiuH861Mf0LTkRQ9J8t7”,
“level”:3,
“time”:“December 16, 2020 19:13:11”,
“remoteAddr”:“79.147.123.81”,
“user”:“user”,
“app”:“mail”,
“method”:“POST”,
“url”:“/valpol/index.php/apps/mail/api/accounts”,
“message”:“Creating account failed: Error connecting to SMTP server.”,
“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:84.0) Gecko/20100101 Firefox/84.0”,
“version”:“20.0.3.2”
}

EDITED:

‘app.mail.verify-tls-peer’ => false
I have tried as well disabling TLS verification for IMAP/SMTP as the docu says, but not


Could be something wrong configured in my server? Because I couldn’t connect the Gmail account neither :expressionless:

SOLVED:

I must to use php-mail to send the emails:

Docu:

Use php-mail for sending mail

You can use the php-mail function to send mails. This is needed for some webhosters (1&1 (1und1)):

‘app.mail.transport’ => ‘php-mail’

In my case for Zoho Mail.

Thank you all :slight_smile:

Could anyone explain why is this needed and what is used instead it by default? Sorry but I am actually learning thanks

SMTP is used by default

1 Like

Where in the file structure to I find app.mail.transport to update it from smtp to php-mail?

config/config.php

Thank you for replying. I don’t see app.mail.transport in the config/config.php file.

Should it exist anywhere else with the value “smtp”?

Do I need to add ‘app.mail.transport’ => ‘php-mail’ to the array in config.php?

No. Unless you know what you are doing php-mail is very specific and won’t work out of the box.

I also installed nextcloud by snap and i can’t find app.mail.transport in the config/config.php file. Is there any way that i can edit or find the app.mail.transport? Thank you.

Are you 100% sure php-mail is what you need? Almost all setups work with SMTP. Don’t blindly switch to php-mail. This will get you past the setup screen but your account is still borked and unable to send any emails.

Thank you for your reply.
I just wanted to fix my error so i thought editing config.php is the solution but
i guess not. it keep says ‘unexpected error during account creation’ please help me. Thank you.

Open a new ticket.

This topic was automatically closed after 13 days. New replies are no longer allowed.