本文整理汇总了PHP中phpmailer::isSMTP方法的典型用法代码示例。如果您正苦于以下问题:PHP phpmailer::isSMTP方法的具体用法?PHP phpmailer::isSMTP怎么用?PHP phpmailer::isSMTP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpmailer
的用法示例。
在下文中一共展示了phpmailer::isSMTP方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_mail
function send_mail($email, $date, $time)
{
require '../phpmailer/PHPMailerAutoload.php';
$mail = new phpmailer();
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'sulemartin87@gmail.com';
$mail->Password = 'Kisamymum96';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->setFrom('sulemartin87@gmail.com', 'Mailer');
$mail->addAddress('' . $email . '', 'user');
$mail->isHTML(true);
$mail->Subject = 'booking';
$mail->Body = 'This email is coming from global styling to: ' . $email . ' </br>
your booking is set for ' . $date . ' at ' . $time . '
thank you for booking with us. Global Styling';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if (!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent to your E-Mail address';
}
}
示例2: sendmail
public function sendmail($from, $to, $subject, $body, $altbody = null, $options = null, $attachments = null, $html = false)
{
if (!is_array($from)) {
$from = array($from, $from);
}
$mail = new phpmailer();
$mail->PluginDir = 'M/lib/phpmailer/';
if ($this->getConfig('smtp')) {
$mail->isSMTP();
$mail->Host = $this->getConfig('smtphost');
if ($this->getConfig('smtpusername')) {
$mail->SMTPAuth = true;
$mail->Port = $this->getConfig('smtpport') ? $this->getConfig('smtpport') : 25;
$mail->SMTPDebug = $this->smtpdebug;
$mail->Username = $this->getConfig('smtpusername');
$mail->Password = $this->getConfig('smtppassword');
}
}
$mail->CharSet = $this->getConfig('encoding');
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->Body = $note . $body;
$mail->AltBody = $altbody;
if (!is_array($from)) {
$from = array($from, $from);
}
$mail->From = $from[0];
$mail->FromName = $from[1];
if (key_exists('reply-to', $options)) {
$mail->AddReplyTo($options['reply-to']);
unset($options['reply-to']);
}
if (key_exists('Sender', $options)) {
$mail->Sender = $options['Sender'];
}
if (null != $attachments) {
if (!is_array($attachments)) {
$attachments = array($attachments);
}
foreach ($attachments as $k => $v) {
if (!$mail->AddAttachment($v, basename($v))) {
trigger_error("Attachment {$v} could not be added");
}
}
}
$mail->IsHTML($html);
$result = $mail->send();
}
示例3: phpmailer
function send_mail()
{
require 'phpmailer/PHPMailerAutoload.php';
$email = "";
$mail = new phpmailer();
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'sulemartin87@gmail.com';
$mail->Password = 'Kisamymum96';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->setFrom('sulemartin87@gmail.com', 'Mailer');
$mail->addAddress('martinsuleman@rocketmail.com', 'user');
$mail->isHTML(true);
$mail->Subject = 'The code works';
$mail->Body = 'This email is coming from <b> GLOBAL STYLING SALONS !! </b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if (!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent to your E-Mail address';
}
}
示例4: phpmailer
echo APP_URL;
?>
/restore/?hash=<?php
echo $restorePointInfo['hash'];
?>
</a> to reset your password.
</body>
</html>
<?php
$from = SMTP_EMAIL;
$to = $email;
$html_text = ob_get_clean();
$subject = APP_TITLE . " | Password reset";
$mail = new phpmailer();
$mail->isSMTP();
// Set mailer to use SMTP
$mail->Host = SMTP_HOST;
// Specify main and backup SMTP servers
$mail->SMTPAuth = SMTP_AUTH;
// Enable SMTP authentication
$mail->Username = SMTP_USERNAME;
// SMTP username
$mail->Password = SMTP_PASSWORD;
// SMTP password
$mail->SMTPSecure = SMTP_SECURE;
// Enable TLS encryption, `ssl` also accepted
$mail->Port = SMTP_PORT;
// TCP port to connect to
$mail->From = $from;
$mail->FromName = APP_TITLE;
示例5: header
if (!$up) {
header("location: reply_mail.php?msg=nup&id=?id");
die;
}
/*
get id for user
*/
require 'connection.php';
$query = $conn->prepare("SELECT email FROM messages WHERE id=?");
$query->bindValue(1, $id, PDO::PARAM_INT);
$query->execute();
$result = $query->fetch(PDO::FETCH_ASSOC);
extract($result);
require_once 'phpmailer/PHPMailerAutoload.php';
$m = new phpmailer();
$m->isSMTP();
$m->SMTPAuth = true;
$m->Host = 'smtpout.secureserver.net';
$m->username = 'jojoallowz';
$m->password = 'Jalal369allowz';
$m->SMTPSecure = 'ssl';
$m->Port = '465';
$m->From = 'admin@pixllart.com';
$m->FromName = 'pixllart.com';
$m->addReplyTo('', '');
$m->addAddress($email, '');
$m->isHtml(true);
$m->subject = 'frist message';
$m->Body = '<p>$msg</p><br><br> <img src="image/' . $img_name . '">';
$m->AltBody = '';
if ($m->send()) {