XF 2.0 Users can't register


Active member
When an user tries to register I get the following error:

Email to ##### failed: Unsupported sendmail command flags [/usr/bin/phpmailer]

#0 src/XF/Mail/Mailer.php(293): Swift_Transport_SendmailTransport->send(Object(Swift_Message), Array)
#1 src/XF/Mail/Mail.php(261): XF\Mail\Mailer->send(Object(Swift_Message), NULL)
#2 src/XF/Service/User/AbstractConfirmationService.php(85): XF\Mail\Mail->send()
#3 src/XF/Service/User/AbstractConfirmationService.php(63): XF\Service\User\AbstractConfirmationService->sendConfirmationEmail()
#4 src/XF/Service/User/Registration.php(306): XF\Service\User\AbstractConfirmationService->triggerConfirmation()
#5 src/XF/Service/User/Registration.php(265): XF\Service\User\Registration->sendRegistrationContact()
#6 src/XF/Service/ValidateAndSavableTrait.php(40): XF\Service\User\Registration->_save()
#7 src/XF/Pub/Controller/Register.php(369): XF\Service\User\Registration->save()
#8 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Register->actionRegister(Object(XF\Mvc\ParameterBag))
#9 src/XF/Mvc/Dispatcher.php(89): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'register', 'json', Object(XF\Mvc\ParameterBag), '', Object(XF\Pub\Controller\Register), NULL)
#10 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(1879): XF\Mvc\Dispatcher->run()
#12 src/XF.php(328): XF\App->run()
#13 index.php(13): XF::runApp('XF\Pub\App')
#14 {main}
array(4) {
  ["url"] => string(23) "/foro/register/register"
  ["referrer"] => string(31) "http://www.eliteguias.com/foro/"
  ["_GET"] => array(0) {
  ["_POST"] => array(15) {
    ["username"] => string(0) ""
    ["6d27d1df2b4f8551ed8e78897db21a21f70172c9"] => string(9) "prueba222"
    ["fe492510547d80d9b9ed46f3fdabf3c5c0fd1594"] => string(24) "prueba234342@hotmail.com"
    ["9811d9ec66dbcfeb18cda34985edb5460f8e90b3"] => string(8) "********"
    ["dob_month"] => string(1) "1"
    ["dob_day"] => string(2) "20"
    ["dob_year"] => string(4) "1980"
    ["captcha_question_answer"] => string(10) "eliteguias"
    ["captcha_question_hash"] => string(40) "4f8e9ebc3eb02dc036244260539c7de4e5da4780"
    ["reg_key"] => string(16) "SiLdTmuTH-Ju_ENA"
    ["ff486a9de6db7e307f9a812451eb32985cee34eb"] => string(16) "Europe/Amsterdam"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(6) "/foro/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
THis only happens after upgrade to Xenforo 2.0


XenForo moderator
Staff member
Hi there,

In Setup > Options > Email options do you have the -f flag set? If so can you remove it and let us know if it works.



XenForo developer
Staff member
The issue is your sendmail_path configuration on your server. It's set to a rather uncommon value and one that doesn't tell us how to interact with it.

You'll either need to change this to a "traditional" value or switch to sending emails via SMTP. You can set a traditional value by adding something like this to src/config.php:
ini_set('sendmail_path', '/usr/sbin/sendmail -t -i');


XenForo developer
Staff member
You have received a response -- I have responded both here and to your ticket.

You will either need to change your sendmail_path directly (since config.php doesn't appear to work, based on what you've said). If that's not an option or that doesn't work, you will need to change XenForo to use SMTP.

Tracy Perry

Well-known member
Well, if your image is correct, it's not unexpected that it's not working for SMTP. You have to put in the correct credentials for SMTP to work - it has to log into the SMTP server and to do that it requires the credentials. Also you will need to know the port # to use and whether it requires SSL/TLS or not.
You need the domain name and port to connect to
You need the account to log in with along with the password
You need to determine if SSL/TLS or none is needed for the encryption.

Those vary with the SMTP service you are connecting to.

Further, when requesting support you have to take into consideration the time zone. Support is typically not provided 24/7/365 AFAIK.
I contacted with my host for login details and now SMTP works great and users can register on the forum, but.... Whats the diference with "normal/default" sistem and SMTP? witch one is better? and if its SMTP better... why is not the option by default?

Tracy Perry

Well-known member
Default is somewhat dependent on your server being set up correctly to handle MTA (RDNS, DKIM, SPF, etc) whereas SMTP uses an existing SMTP server that is already configured to handle mail (either provided by your hosting service or through a 3rd party service like SparkPost, SendGrid, etc).