Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal get site wide email address?

Tags:

email

drupal

In my module I want to get the site wide email address - the one that is set in the site information admin pages and that is used for all automatically send email messages.

How can I do this?

like image 775
Finbarr Avatar asked Aug 09 '10 18:08

Finbarr


4 Answers

$site_email = variable_get('site_mail', '');
like image 97
Kevin Avatar answered Nov 05 '22 15:11

Kevin


In Drupal 8:

$site_mail = \Drupal::config('system.site')->get('mail');
like image 28
baikho Avatar answered Nov 05 '22 15:11

baikho


Looking into the system module, I found the settings form references the following:

variable_get('site_mail', ini_get('sendmail_from'));
like image 17
cgp Avatar answered Nov 05 '22 15:11

cgp


You can get more ideas with this link

variable_get('site_mail', ini_get('sendmail_from'));
like image 3
Manish Avatar answered Nov 05 '22 15:11

Manish