summaryrefslogtreecommitdiffstats
path: root/drupal_mail_test.php
blob: 8c9725f3cd0a32c0fd10560e3f6c24b0577094eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
  // for now copy/paste this into devel's module 'Execute PHP Code' page
  $my_module = 'no_module';
  $my_mail_token = 'no_token';
  $from = variable_get('site_mail', ini_get('sendmail_from'));
  $to = 'kyle@xenomedia.com';
  $message = array(
    'id' => $my_module . '_' . $my_mail_token,
    'to' => $to,
    'subject' => 'test',
    'body' => 'test',
    'headers' => array(
      'From' => $from, 
      'Sender' => $from, 
      'Return-Path' => $from,
    ),
  );
  $system = drupal_mail_system('no_module', $my_mail_token);
  if ($system->mail($message)) {
    dpm('ok');
  }
  else {
    dpm('error');
  }

?>