reformat initial comment block.
[openemr.git] / library / classes / postmaster.php
blob1e009ed6463c36b6551ce2c84cf2361db8be7f2a
1 <?php
2 // Copyright (C) 2010 Open Support LLC
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
8 require_once ($GLOBALS['srcdir'] . "/classes/class.phpmailer.php");
10 // Add these two lines to Authenticate in phpmailer.php, lines 633-634
11 // Customized for Web hosts that don't require SMTP authentication
12 // if ($SMTP_Auth=="No") { $connection = true; }
13 // Also, remove "25" in line 185 and change $Port to $this->Port on line 612 so that it can read Admin's setting
15 class MyMailer extends PHPMailer
17 var $Mailer;
18 var $SMTPAuth;
19 var $Host;
20 var $Username;
21 var $Password;
22 var $Port;
23 var $CharSet;
25 function MyMailer()
27 $this->emailMethod();
30 function emailMethod()
32 global $HTML_CHARSET;
33 $this->CharSet = $HTML_CHARSET;
34 switch($GLOBALS['EMAIL_METHOD'])
36 case "PHPMAIL" :
38 $this->Mailer = "mail";
40 break;
41 case "SMTP" :
43 global $SMTP_Auth;
44 $this->Mailer = "smtp";
45 $this->SMTPAuth = $SMTP_Auth;
46 $this->Host = $GLOBALS['SMTP_HOST'];
47 $this->Username = $GLOBALS['SMTP_USER'];
48 $this->Password = $GLOBALS['SMTP_PASS'];
49 $this->Port = $GLOBALS['SMTP_PORT'];
51 break;
52 case "SENDMAIL" :
54 $this->Mailer = "sendmail";
56 break;