comparison sites/all/modules/smtp/smtp.module @ 9:830c812b520f

added smtp module
author root <root@paio.local>
date Mon, 28 Oct 2013 15:34:27 +0000
parents
children
comparison
equal deleted inserted replaced
8:49b8ebaaad78 9:830c812b520f
1 <?php
2
3 /**
4 * @file
5 * Enables Drupal to send e-mail directly to an SMTP server.
6 *
7 * This module uses a customized extract of the PHPMailer
8 * library (originally by Brent R. Matzelle, now maintained
9 * by Codeworx Tech.) relicensed from LGPL to GPL, included
10 * as a part of the module.
11 *
12 * Overriding mail handling in Drupal to make SMTP the default
13 * transport layer, requires to change the mail_system variable's
14 * default value array('default-system' => 'DefaultMailSystem').
15 * This module uses array('default-system' => 'SmtpMailSystem').
16 */
17
18 /**
19 * Implements hook_help().
20 */
21 function smtp_help($path, $arg) {
22 switch ($path) {
23 case 'admin/help#smtp':
24 return t('Allow for site emails to be sent through an SMTP server of your choice.');
25 }
26 }
27
28 /**
29 * Implements hook_menu().
30 */
31 function smtp_menu() {
32 $items['admin/config/system/smtp'] = array(
33 'title' => 'SMTP Authentication Support',
34 'page callback' => 'drupal_get_form',
35 'page arguments' => array('smtp_admin_settings'),
36 'access arguments' => array('administer smtp module'),
37 'description' => 'Allow for site emails to be sent through an SMTP server of your choice.',
38 'file' => 'smtp.admin.inc',
39 );
40 return $items;
41 }
42
43 /**
44 * Implements hook_permission().
45 */
46 function smtp_permission() {
47 return array(
48 'administer smtp module' => array(
49 'title' => t('Administer SMTP Authentication Support module'),
50 'description' => t('Perform administration tasks for SMTP Authentication Support module.'))
51 );
52 }
53
54
55 /**
56 * Implements hook_mail().
57 */
58 function smtp_mail($key, &$message, $params) {
59 if ($key == 'smtp-test') {
60 $message['subject'] = $params['subject'];
61 $message['body'] = $params['body'];
62 }
63 }