Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7793643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:33:09+00:00 2026-06-01T22:33:09+00:00

How can i do configuration of emails in admin panel in Symfony? Default i

  • 0

How can i do configuration of emails in admin panel in Symfony?
Default i must set this in file factories.yml:

mailer:
  class: sfMailer
  param:
    logging:           %SF_LOGGING_ENABLED%
    charset:           %SF_CHARSET%
    delivery_strategy: realtime
    transport:
      class: Swift_SmtpTransport
      param:
        host:       localhost
        port:       25
        encryption: ~
        username:   ~
        password:   ~

I would like set host, port, encryption, username and password in admin panel and keep this in my database. So how can i get this data from database if i send mail?

    $message = $this->getMailer()->compose(
      array('jobeet@example.com' => 'Jobeet Bot'),
      $affiliate->getEmail(),
      'Jobeet affiliate token',
      <<<EOF
Your Jobeet affiliate account has been activated.

Your token is {$affiliate->getToken()}.

The Jobeet Bot.
EOF
    );

    $this->getMailer()->send($message);

I can get this data from database 🙂 but i dont know how to write in to getMailer().

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:33:11+00:00Added an answer on June 1, 2026 at 10:33 pm

    There is an event fired when the mailer is configured.

    $dispatcher->notify(new sfEvent($this, 'mailer.configure'));
    

    So you can add a listener on this event, retrieve the mailer object, and re-configure it.

    Or, as describe in this snippet, you can built manually the call to the mailer and define how you set the config (and got the advantage to use getMailer in a task): http://snippets.symfony-project.org/snippet/377

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a configuration file where a developer can specify a text color by
I simply can not get Visual Studio 2005 to find the System.Configuration.ConfigurationManager class. Here
I have a View where the user can select Basic Configuration and Advanced Configuration
How can I save the configuration of a web part for a certain web
I can't find any configuration for the recent tendency of the Eclipse checkstyle plugin
How can I prepare the configuration settings (App.config, maybe?) I need to use Enterprise
Proxy configuration of a machine can be easily fetched using def check_proxy(): import urllib2
Can someone provide me with an optimize .htaccess configuration that handles compression, browser caching,
How can I apply the configuration chosen by the user, in each activty of
How can i get the Server configuration like System Name, SERVER Name, CPU, Physical

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.