本文整理汇总了PHP中SMTP::Delivery方法的典型用法代码示例。如果您正苦于以下问题:PHP SMTP::Delivery方法的具体用法?PHP SMTP::Delivery怎么用?PHP SMTP::Delivery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMTP
的用法示例。
在下文中一共展示了SMTP::Delivery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_email
function send_email($to_email, $to_name, $theme, $text_text, $text_html = '')
{
global $config;
if (!$config['smtp_adress']) {
output_message('alert', 'Set SMTP settings in config !');
return false;
}
if (!$to_email) {
output_message('alert', 'Field "to" is empty.');
return false;
}
set_time_limit(300);
require_once 'core/mail/smtp.php';
$mail = new SMTP();
$mail->Delivery('relay');
$mail->Relay($config['smtp_adress'], $config['smtp_username'], $config['smtp_password']);
$mail->From($config['site_email'], $config['base_href']);
$mail->AddTo($to_email, $to_name);
$mail->Text($text_text);
if ($text_html) {
$mail->Html($text_html);
}
$sent = $mail->Send($theme);
return $sent;
}
示例2: sendMail
public function sendMail($assunto, $mensagem, $email_para = null)
{
$dados_envio = $this->configuracoesGerais(array('email_destinatario', 'email_remetente_host', 'email_remetente', 'email_remetente_senha'));
//DADOS SMTP
if (!empty($dados_envio)) {
$smtp = $dados_envio['Configuracao']['email_remetente_host'];
$usuario = $dados_envio['Configuracao']['email_remetente'];
$senha = $dados_envio['Configuracao']['email_remetente_senha'];
if ($email_para == null) {
$email_para = $dados_envio['Configuracao']['email_destinatario'];
}
} else {
$smtp = "smtp.zoio.net.br";
$usuario = "tester@zoio.net.br";
$senha = "zoio2010";
if ($email_para == null) {
$email_para = 'zoiodev@zoio.net.br';
}
}
$email_de = $usuario;
require_once './smtp/smtp.php';
$mail = new SMTP();
$mail->Delivery('relay');
$mail->Relay($smtp, $usuario, $senha, 587, 'login', false);
//$mail->addheader('content-type', 'text/html; charset=utf-8');
//$mail->addheader('content-type', 'text/html; charset=iso-8859-1');
$mail->TimeOut(10);
$mail->Priority('normal');
$mail->From($email_de);
$mail->AddTo($email_para);
//$mail->AddBcc('zoiodev@zoio.net.br');
$mail->Html($mensagem);
if ($mail->Send($assunto)) {
//echo '_SMTP+_Enviou para g......@zoio.net.br';
return true;
} else {
//echo '_SMTP+_Não enviou e-mail';
return false;
}
}
示例3: send_email
function send_email($to_email, $to_name, $theme, $text_text, $text_html = '')
{
global $MW;
if (!(string) $MW->getConfig->generic->smtp_adress) {
output_message('alert', 'Set SMTP settings in config !');
return false;
}
if (!$to_email) {
output_message('alert', 'Field "to" is empty.');
return false;
}
set_time_limit(300);
include 'core/mail/smtp.php';
$mail = new SMTP();
$mail->Delivery('relay');
$mail->Relay((string) $MW->getConfig->generic->smtp_adress, (string) $MW->getConfig->generic->smtp_username, (string) $MW->getConfig->generic->smtp_password);
$mail->From((string) $MW->getConfig->generic->site_email, (string) $MW->getConfig->generic->site_title);
$mail->AddTo($to_email, $to_name);
$mail->Text($text_text);
if ($text_html) {
$mail->Html($text_html);
}
$sent = $mail->Send($theme);
return $sent;
}