本文整理汇总了PHP中PHPMailer::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPMailer::__construct方法的具体用法?PHP PHPMailer::__construct怎么用?PHP PHPMailer::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPMailer
的用法示例。
在下文中一共展示了PHPMailer::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
// use PHPMailer with exceptions
parent::__construct(true);
// allow an "empty" body to be sent
$this->AllowEmpty = true;
}
示例2: ClaroPHPMailer
function ClaroPHPMailer()
{
//prevent phpMailer from echo'ing anything
parent::__construct(true);
// set charset
$this->CharSet = get_locale('charset');
if (get_conf('smtp_host') != '') {
// set smtp mode and smtp host
$this->IsSMTP();
$this->Host = get_conf('smtp_host');
if (get_conf('smtp_username') != '') {
// SMTP authentification
$this->SMTPAuth = true;
// turn on SMTP
$this->Username = get_conf('smtp_username');
// SMTP username
$this->Password = get_conf('smtp_password');
// SMTP password
}
if (get_conf('smtp_port') != '') {
$this->Port = (int) get_conf('smtp_port');
}
if (get_conf('smtp_secure') != '') {
$this->SMTPSecure = get_conf('smtp_secure');
}
} else {
// set sendmail mode
$this->IsMail();
}
}
示例3: __construct
/**
* The constructor of a class
*
* @param array $config array( emails => array, letter => content, smtpProfile => data)
*
* @return void
* @since 1.0
*/
public function __construct($params = null)
{
if ($params) {
$this->_setData($params);
}
parent::__construct(!empty($params['exceptions']));
}
示例4: switch
function __construct()
{
global $dataDir, $config;
parent::__construct();
$this->Reset();
$this->PluginDir = $dataDir . '/include/thirdparty/PHPMailer/';
$this->CharSet = 'utf-8';
$this->ContentType = 'text/html';
$mail_method = $this->Mail_Method();
switch ($mail_method) {
//smtp & smtpauth
case 'smtpauth':
$this->SMTPAuth = true;
$this->Username = \gp\tool::ConfigValue('smtp_user', '');
$this->Password = \gp\tool::ConfigValue('smtp_pass', '');
case 'smtp':
$this->IsSMTP();
$this->Host = \gp\tool::ConfigValue('smtp_hosts', '');
break;
//sendmail
//sendmail
case 'sendmail':
$this->IsSendmail();
$this->Sendmail = $this->Sendmail_Path();
break;
//mail
//mail
default:
$this->IsMail();
$this->Mailer = 'mail';
break;
}
}
示例5: __construct
public function __construct()
{
parent::__construct(true);
$this->IsHTML(true);
$this->WordWrap = 80;
$this->Timeout = 30;
}
示例6: __construct
public function __construct($exceptions = false)
{
parent::__construct($exceptions);
//Tell PHPMailer to use SMTP
$this->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$this->SMTPDebug = 0;
//Ask for HTML-friendly debug output
$this->Debugoutput = 'html';
//Set the hostname of the mail server
$this->Host = "smtp.gmail.com";
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$this->Port = 587;
//Set the encryption system to use - ssl (deprecated) or tls
$this->SMTPSecure = 'tls';
//Whether to use SMTP authentication
$this->SMTPAuth = true;
//Username to use for SMTP authentication
$this->Username = Config::get('gmail.smtp.username', 'brettcraigdutton@gmail.com');
//Password to use for SMTP authentication
$enPassword = Config::get('gmail.smtp.password', ':e:sWQlpSVotD8PGXxS5kAuHlq0gMH522qtQkCYCQ0DVBI=');
$cr = new Cryptography(Cryptography::RAND_KEY);
$this->Password = $cr->decrypt($enPassword);
}
示例7: __construct
public function __construct($container = null)
{
if (!is_object($container)) {
$container = Application::getInstance()->getContainer();
}
parent::__construct();
$config = $container->appConfig;
$smtpauth = $config->get('mail.smtpauth') == 0 ? null : 1;
$smtpuser = $config->get('mail.smtpuser');
$smtppass = $config->get('mail.smtppass');
$smtphost = $config->get('mail.smtphost');
$smtpsecure = $config->get('mail.smtpsecure');
$smtpport = $config->get('mail.smtpport');
$mailfrom = $config->get('mail.mailfrom');
$fromname = $config->get('mail.fromname');
$mailer = $config->get('mail.mailer');
$this->SetFrom($mailfrom, $fromname);
$this->container = $container;
switch ($mailer) {
case 'smtp':
$this->useSMTP($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport);
break;
case 'sendmail':
$this->IsSendmail();
break;
default:
$this->IsMail();
break;
}
}
示例8: __construct
public function __construct($exceptions = false)
{
$addon = rex_addon::get('phpmailer');
$this->From = $addon->getConfig('from');
$this->FromName = $addon->getConfig('fromname');
$this->ConfirmReadingTo = $addon->getConfig('confirmto');
$this->Mailer = $addon->getConfig('mailer');
$this->Host = $addon->getConfig('host');
$this->Port = $addon->getConfig('port');
$this->CharSet = $addon->getConfig('charset');
$this->WordWrap = $addon->getConfig('wordwrap');
$this->Encoding = $addon->getConfig('encoding');
if ($addon->getConfig('priority') == 0) {
$this->Priority = null;
} else {
$this->Priority = $addon->getConfig('priority');
}
$this->SMTPDebug = $addon->getConfig('smtp_debug');
$this->SMTPSecure = $addon->getConfig('smtpsecure');
$this->SMTPAuth = $addon->getConfig('smtpauth');
$this->Username = $addon->getConfig('username');
$this->Password = $addon->getConfig('password');
if ($bcc = $addon->getConfig('bcc')) {
$this->AddBCC($bcc);
}
$this->PluginDir = $addon->getPath('lib/phpmailer/');
parent::__construct($exceptions);
}
示例9: __construct
/**
* Sole constructor
*/
public function __construct()
{
parent::__construct();
global $locale;
global $current_user;
global $sugar_config;
$admin = new Administration();
$admin->retrieveSettings();
if (isset($admin->settings['disclosure_enable']) && !empty($admin->settings['disclosure_enable'])) {
$this->disclosureEnabled = true;
$this->disclosureText = $admin->settings['disclosure_text'];
}
$this->oe = new OutboundEmail();
$this->oe->getUserMailerSettings($current_user);
$this->SetLanguage('en', 'include/phpmailer/language/');
$this->PluginDir = 'include/phpmailer/';
$this->Mailer = 'smtp';
// cn: i18n
$this->CharSet = $locale->getPrecedentPreference('default_email_charset');
$this->Encoding = 'quoted-printable';
$this->IsHTML(false);
// default to plain-text email
$this->Hostname = $sugar_config['host_name'];
$this->WordWrap = 996;
// cn: gmail fix
$this->protocol = $this->oe->mail_smtpssl == 1 ? "ssl://" : $this->protocol;
}
示例10:
/**
* initialize some member
*/
function __construct($exception = true)
{
$config = \Jelix\Core\App::config();
$this->defaultLang = $config->locale;
$this->CharSet = $config->charset;
$this->Mailer = $config->mailer['mailerType'];
if ($config->mailer['mailerType']) {
$this->Mailer = $config->mailer['mailerType'];
}
$this->Hostname = $config->mailer['hostname'];
$this->Sendmail = $config->mailer['sendmailPath'];
$this->Host = $config->mailer['smtpHost'];
$this->Port = $config->mailer['smtpPort'];
$this->Helo = $config->mailer['smtpHelo'];
$this->SMTPAuth = $config->mailer['smtpAuth'];
$this->SMTPSecure = $config->mailer['smtpSecure'];
$this->Username = $config->mailer['smtpUsername'];
$this->Password = $config->mailer['smtpPassword'];
$this->Timeout = $config->mailer['smtpTimeout'];
if ($config->mailer['webmasterEmail'] != '') {
$this->From = $config->mailer['webmasterEmail'];
}
$this->FromName = $config->mailer['webmasterName'];
$this->filePath = \Jelix\Core\App::varPath($config->mailer['filesDir']);
$this->copyToFiles = $config->mailer['copyToFiles'];
parent::__construct(true);
}
示例11: __construct
public function __construct($exceptions = false) {
parent::__construct($exceptions);
$sysvar = new JTSysvar();
$this->service_email = $sysvar->get(self::SERVICE_EMAIL);
$this->service_email_name = $sysvar->get(self::SERVICE_EMAIL_NAME);
$this->CharSet = "UTF-8";
$this->IsHTML(true);
}
示例12: __construct
public function __construct($a_seuil = 50, $a_lien = true)
{
$this->seuil = $a_seuil;
$this->lien = $a_lien;
//$this->CharSet = "utf-8";
parent::__construct(true);
//Creation de mail au format html
}
示例13: __construct
/**
* Construct Notifier object
* @param \Beaver\Dateval\EventBuilder $event
* @param \Beaver\Dateval\EmailTemplate $template
*/
public function __construct(EventBuilder $event, EmailTemplate $template)
{
$this->event = $event;
$this->EmailTemplate = $template;
// PHPMailer constructor
parent::__construct();
$this->EmailTemplate->parse($event);
}
示例14: __construct
public function __construct($exceptions = false)
{
parent::__construct($exceptions);
if (file_exists("language/phpmailer.lang-" . Yii::app()->language . ".php")) {
$mail->SetLanguage(Yii::app()->language, "language/phpmailer.lang-" . Yii::app()->language . ".php");
}
$this->IsHTML(true);
}
示例15: __construct
public function __construct()
{
parent::__construct();
// initialise global variable
global $Registry;
//use core global variable $Registry
$this->registry = $Registry;
}