sendBulkEmails.php is a MediaWiki maintenance script found in WikimediaMaintenance. It can be used to send an email to given list of Users. The maintenance script will send emails using User::sendMail. Bounce tracking will be automatically taken care of by BounceHandler if installed for the wiki.


  • Read message body from a file
  • Read recipients from a file, one per line
  • Only send to accounts with confirmed email addresses
  • Only send to accounts that have not opted out of email contact from other users
  • Optional: check users against an opt-out list maintained on-wiki
  • Optional: set a From: address based on a User's account
  • Optional: set a Reply-To: address based on a User's account
  • Track bounces and unconfirm user emails if needed when BounceHandler is installed


List of users to email, one per line (file)
Email subject (string)
Email body (file).
Email sender (username). Optional.
wikipage containing list of users to exclude from contact (title). Optional.
Reply-To address (username). Optional.
Time to wait between emails (seconds). Default is 5 seconds.
Do not send emails.


$ mwscript extensions/WikimediaMaintenance/sendBulkEmails.php --wiki=labswiki \
  --subject "This is the email subject" \
  --body "/path/to/file/containing/body.txt" \
  --from "UserSendingTheEmail" \
  --to "/path/to/file/containing/users.txt" \
  --reply-to "UserReceivingReplies" \
  --optout "Title_of_Opt-out_page"