Drupal Smtp module
<?php
require_once './includes/bootstrap.inc';
/*
define('DRUPAL_BOOTSTRAP_CONFIGURATION', 0);
define('DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE', 1);
define('DRUPAL_BOOTSTRAP_DATABASE', 2);
define('DRUPAL_BOOTSTRAP_ACCESS', 3);
define('DRUPAL_BOOTSTRAP_SESSION', 4);
define('DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE', 5);
define('DRUPAL_BOOTSTRAP_PATH', 6);
define('DRUPAL_BOOTSTRAP_FULL', 7);
*/
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$message = array(
'to' => 'to@xxx.com',
'subject' => 'Test Mail',
'body' => 'Bla bla bla',
'from'=> 'webmaster@xxx.com',
'headers' => array(
'From' => 'webmaster<webmaster@xxx.com>',
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8',
'Content-Transfer-Encoding' => '8Bit',
'X-Mailer' => 'Drupal'),
);
$success = smtp_drupal_mail_wrapper($message);
var_dump($success );
?>
沒有留言:
張貼留言