Results 1 to 3 of 3

Thread: Friendly Email Addresses don't work

  1. #1
    New user
    Join Date
    08-14-09.
    Posts
    28

    Default Friendly Email Addresses don't work

    Hello again Thyon,

    when I use a friendly confirmation sender address (John Doe [johnny@gmail.com]) I get the following error:

    Code:
    Fatal error: Uncaught exception Swift_RfcComplianceException  with message Address in mailbox given [] does not comply with RFC 2822, 3.6.2.  thrown in /var/www/website/plugins/swiftmailer/classes/Swift/Mime/Headers/MailboxHeader.php  on line 309
    
    #0 /var/www/website/plugins/swiftmailer/classes/Swift/Mime/Headers/MailboxHeader.php(239): Swift_Mime_Headers_MailboxHeader->_assertValidAddress('normalizeMailboxes(Array)
    #2 /var/www/website/plugins/swiftmailer/classes/Swift/Mime/Headers/MailboxHeader.php(61): Swift_Mime_Headers_MailboxHeader->setNameAddresses(Array)
    #3 /var/www/website/plugins/swiftmailer/classes/Swift/Mime/SimpleMimeEntity.php(571): Swift_Mime_Headers_MailboxHeader->setFieldBodyModel(Array)
    #4 /var/www/website/plugins/swiftmailer/classes/Swift/Mime/SimpleMessage.php(199): Swift_Mime_SimpleMimeEntity->_setHeaderFieldModel('From', Array)
    #5 /var/www/website/system/libraries/Email.php(433): Swift_Mime_SimpleMessage->setFrom('sendTo('johnny...')
    #7 /var/www/website/system/modules/frontend/Form.php(442): FormAuto->processFormData(Array, Array, Array)
    #8 /var/www/website/system/modules/frontend/Form.php(208): Form->processFormData(Array)
    #9 /var/www/website/system/modules/frontend/Hybrid.php(152): Form->compile()
    #10 /var/www/website/system/modules/frontend/Form.php(74): Hybrid->generate()
    #11 /var/www/website/system/libraries/Controller.php(415): Form->generate()
    #12 /var/www/website/system/modules/frontend/ModuleArticle.php(173): Controller->getContentElement('104')
    #13 /var/www/website/system/modules/frontend/Module.php(129): ModuleArticle->compile()
    #14 /var/www/website/system/modules/frontend/ModuleArticle.php(71): Module->generate()
    #15 /var/www/website/system/libraries/Controller.php(348): ModuleArticle->generate(false)
    #16 /var/www/website/system/libraries/Controller.php(221): Controller->getArticle('57', false, false, 'main')
    #17 /var/www/website/system/modules/frontend/PageRegular.php(71): Controller->getFrontendModule('0', 'main')
    #18 /var/www/website/index.php(198): PageRegular->generate(Object(DB_Mysqli_Result))
    #19 /var/www/website/index.php(321): Index->run()
    #20 {main}
    if I use the unfriendly version, it works without any problem. It seems the "[]" should be replaced by "<>" at some point, but they aren't.

  2. #2
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Friendly Email Addresses don't work

    If you look at the code in line 1322, it is being replaced in the FROM field. Perhaps leo has modifed something in the Email.php class... Please specify which version of TL/Contao you are using...

    Code:
    $from = str_replace(array('[', ']'), array('<', '>'), $arrForm['mailFrom']);

  3. #3
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Friendly Email Addresses don't work

    It seems the FROM field needed some more special treatment. I've split it correctly now and assigned it. The error no longer occurs. Update to the latest build.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •