[Drupal 8] How to configure SMTP in Drupal 8 using Swift Mailer Module ?
BY jimmy.sebastian
4 years ago
0 comments comment

In one of my Drupal 8 work I needed to configure SMTP using swiftmailer Module. The module extends the basic mail sending functionality which is provided by Drupal by delegating all mail handling to Swift Mailer library. This library provides features, such as :

  • Sends e-mails directly through an SMTP server of our choice, that is a locally installed MTA agent such as sendmail or the mail functionality which is provided by PHP.
  • Sending HTML e-mails(MIME).
  • Adds file attachments along with mails.
  • Adds inline images to e-mails.

The Swift Mailer module depends on the mailsystem module which is responsible for making the Swift Mailer module available to Drupal. You have to install SwiftMailer Library before enabling swiftmailer module. The preferred way to install Swiftmailer is via Composer. Use the following command for this:

$ composer require swiftmailer/swiftmailer

Once the module is installed, you can set Drupal to use swiftmailer as default mail system to send HTML mails with the following settings.

Configure Mail System

Configure the Mail System page (admin/config/system/mailsystem) to Global Mail System configuration.

Configure SwiftMailer Settings

Go to the Mail System page (admin/config/swiftmailer/transport) to configure Swift Mailer transport and message settings.
For more details click here



on 16th January 2008 / by webmaster
Most webmasters do not realize this, but a lot of the content on lot of websites can be accessed from multiple URLs. A simple example would be where www.example.com and example.com leads to the same page. This is a fatal mistake in Search Engine Optimization and search engines penalize you for duplicate content. The correct configuration would be where the above two urls will lead you to the same page but example.com will redirect you to www.example.com with a 301 (Moved permanently) status which will not result in search engines penalizing the page. It is very easy to configure 301 redirects using Apache .htaccess file and the process is the same for a Drupal installation also. Drupal Technical Apache htaccess SEO Add new comment