$from parameter is not set

Created on 6 March 2025, 4 days ago

According to the module description, it should be possible to set the sending email address with the $from parameter

simple_mail_send($from, $to, $subject, $body);

However, this does not appear to work. After taking a look at the code, it appears that MailManager is being used to send the mail. This does not accept a $from parameter, but rather has a $reply paramter that sets the Reply-To header. This means that all mail send with simple_mail is sent from the system.site email address.

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Mail%21Ma...

MailManager is a replacement for drupal_mail, which did accept a $from parameter.

https://api.drupal.org/api/drupal/includes%21mail.inc/function/drupal_ma...

My suspicion is that when this module was upgraded from the Drupal 7 version this difference was missed.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States srdtwc Skokie, IL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024