Created
November 14, 2013 23:36
-
-
Save chales/7476388 to your computer and use it in GitHub Desktop.
Test Drupal email. Edit and add to the Drupal docroot to see if you can send a message. Note that this will not hook phpmailer or other libs that may be in use. Mainly for a quick proof of life type of check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Replace <user>@<host>, place in a drupal docroot, hit it with a browser. | |
require_once './includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
$message = array( | |
'id' => 'email_tester', | |
'to' => '<user>@<host>', | |
'subject' => t('Test subject'), | |
'body' => t('This is a test message to fill in the body.'), | |
'headers' => array('From' => '<user>@<host>'), | |
); | |
if (drupal_mail_send($message)) { | |
print 'Message sent'; | |
} else { | |
print 'Message Failed'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment