A machine-readable guide to this site for AI agents and language models is available at/llms.txt(https://dev.acquia.com/llms.txt on the production site).
drush php-eval '$mailManager = \Drupal::service("plugin.manager.mail");
$params["context"]["subject"] = "Test mail subject.";
$params["context"]["message"] = "Test mail message.";
$to = "[email protected]"; // Email address needs to be sent to
$langcode = "en"; // Change the language code if appropriate
$result = $mailManager->mail("system", "mail", $to, $langcode, $params);
if ($result["result"] !== true) {
echo t("There was a problem sending your mail and it was not sent.");
}
else {
echo t("Your message has been sent.");
}' -l your-site.com
In all these examples, replace [email protected] with a real recipient email address. The From address can be a no-reply address, but it must be a verified domain within the Platform Email settings. Note that the Drush example uses the site's main email address.
After running the command and receiving an email, you can review the headers and verify that the email itself is sent by Platform Email.