TransWikia.com

Using swiftmailer, how to check if an email was sent successfully?

Drupal Answers Asked on October 26, 2021

For example, when Drupal core contact forms fail to send an email for any reason, swiftmailer throws an exception and logs a message. However, I am trying to hook into the process to display appropriate information for my enduser after a contact attempt fail.

For more information drupal contact form does the following to send a message in MessageForm.php:

 $this->mailHandler->sendMailMessages($message, $user);

This trigger the mailManger->mail method which only throws an exception if the mail system had any issues. Here is the relevant code in swiftmailer
Is it possible to determine if the mail failed within the the save method of MessageForm.php?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP