本文整理汇总了PHP中mail::send方法的典型用法代码示例。如果您正苦于以下问题:PHP mail::send方法的具体用法?PHP mail::send怎么用?PHP mail::send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mail
的用法示例。
在下文中一共展示了mail::send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testEmail
function testEmail()
{
$email = new mail();
if ($email->send($_POST['email'], '测试用户', '这是一封测试邮件!', '这是一封测试邮件!你看到此邮件,说明你的邮箱已经配置好了。欢迎来到' . '<a href="' . __WEB__ . '">' . C('WEB_NAME') . '</a><br /><a href="http://www.houdunwang.com"><img src="http://bbs.houdunwang.com/static/image/common/logo.png" alt="后盾PHP培训" /></a>')) {
$this->success('邮件发送成功');
}
$this->success('邮件发送失败');
}
示例2: compra
public static function compra($data)
{
// dd($data);
mail::send('correos.compra', $data, function ($messages) use($data) {
$messages->from(env('MAIL_USERNAME'), env('MAIL_NAME'));
$messages->subject(' 🏆 ¡Felicitaciones! Gracias por su Compra ...');
$messages->to($data["correo"]);
});
}
示例3: send
function send()
{
/*
send mail
*/
mail::from('lessio@lessio.ru');
mail::html(urldecode(params::get('u_name')) . ':' . urldecode(params::get('u_email')) . ': ' . urldecode(params::get('u_text')));
mail::subject('Сайтик шлет письмо');
mail::send('lessio@lessio.ru');
}
示例4: sendFeedback
function sendFeedback()
{
$mail_content = params::get('message');
$email = params::get('email');
if (!empty($mail_content) && !empty($email)) {
mail::from($email);
mail::html($mail_content);
mail::subject(settings::get('feedback', 'feedback_subject'));
mail::send(settings::get('feedback', 'feedback_email'));
headers::url('/contacts/success/');
}
}
示例5: index
public function index(MailRequest $request)
{
$contactName = $request->input('name');
$contactEmail = $request->input('email');
$contactNumber = $request->input('contact_number');
$contactMessage = $request->input('message');
$data = ['name' => $contactName, 'email' => $contactEmail, 'number' => $contactNumber, 'bodyMessage' => $contactMessage];
mail::send('articles.enquiry', $data, function ($message) {
$message->to('a.d.johnson@live.co.uk', 'Adam Johnson')->subject('Website Enquiry');
$message->from('adam@ajdigital.uk', 'AJDigital');
});
return redirect('/')->with(['flash_message' => 'Your message has been sent', 'flash_message_important' => false]);
}
示例6: validURLCheck
/**
* Prueft die URL damit keine boesen URLS uebergeben werden koennen
* @param $param
*/
function validURLCheck($param)
{
if (strstr($param, '://')) {
// Der APP_ROOT muss in der URL vorkommen, sonfern es kein relativer Pfad ist
// HTTPS und HTTP
if (mb_strpos($param, APP_ROOT) !== 0 && mb_strpos(mb_str_replace("http://", "https://", $param), APP_ROOT) !== 0 && mb_strpos(mb_str_replace("https://", "http://", $param), APP_ROOT) !== 0) {
$text = "Dies ist eine automatische Mail.\nEs wurde eine mögliche XSS Attacke durchgefuehrt:\n";
$text .= "\nFolgende URL wurde versucht aufzurufen: \n" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$text .= "\n\nIP des Aufrufers: " . $_SERVER['REMOTE_ADDR'];
$text .= "\n\nUserAgent: " . $_SERVER['HTTP_USER_AGENT'];
$text .= "\n\nAuffälliger Value: {$param}";
$mail = new mail(MAIL_ADMIN, 'no-reply@' . DOMAIN, 'Versuchte XSS Attacke', $text);
$mail->send();
die('Invalid URL detected');
}
}
}
示例7: email_reply
function email_reply()
{
//验证权限,跳转提示页面
if (!in_array(parent::reply_access, $this->admin_access)) {
http::skip('login/forbid');
}
$tip_info = array('error' => 1, 'info' => 'send email failed');
if (post('email', 'isset')) {
//接收数据
$email = post('email', 'post');
$title = post('title', 'title');
$content = post('content', 'info');
//发送邮件
mail::send($email, $title, $content);
$tip_info = array('error' => 0, 'info' => 'email sent');
}
http::json($tip_info);
}
示例8: sendMailInternational
function sendMailInternational()
{
$emailtext = "Dies ist eine automatisch generierte E-Mail.<br><br>";
$emailtext .= "Es hat sich ein neuer Outgoing am System registriert.</b>";
$mail = new mail(MAIL_INTERNATIONAL_OUTGOING, 'no-reply', 'New Outgoing', 'Bitte sehen Sie sich die Nachricht in HTML Sicht an, um den Link vollständig darzustellen.');
$mail->setHTMLContent($emailtext);
$mail->send();
}
示例9: sendEMail
function sendEMail($nFromUserId, $sSubject, $sText, $bSendEMailAddress)
{
global $opt, $translate;
if ($this->exist() == false) {
return false;
}
if ($this->getIsActive() == false) {
return false;
}
if ($this->getEMail() === null || $this->getEMail() == '') {
return false;
}
if ($sSubject == '') {
return false;
}
if ($sText == '') {
return false;
}
if (mb_strpos($sSubject, "\n") !== false) {
$sSubject = mb_substr($sSubject, 0, mb_strpos($sSubject, "\n"));
}
$sSubject = mb_trim($sSubject);
$fromUser = new user($nFromUserId);
if ($fromUser->exist() == false) {
return false;
}
if ($fromUser->getIsActive() == false) {
return false;
}
if ($fromUser->getEMail() === null || $fromUser->getEMail() == '') {
return false;
}
$language = $this->getLanguageCode();
if (!$language) {
$language = $opt['template']['locale'];
}
// ok, we can send ...
$mail = new mail();
$mail->name = 'usercontactmail';
$mail->to = $this->getEMail();
$mail->recipient_locale = $this->getLanguageCode();
$mail->from = $opt['mail']['usermail'];
if ($bSendEMailAddress == true) {
$mail->replyTo = $fromUser->getEMail();
$mail->returnPath = $fromUser->getEMail();
}
$mail->subject = $translate->t('E-Mail from', '', basename(__FILE__), __LINE__, '', 1, $language) . ' ' . $fromUser->getUsername() . ': ' . $sSubject;
$mail->assign('usersubject', $sSubject);
$mail->assign('text', $sText);
$mail->assign('username', $this->getUsername());
$mail->assign('sendemailaddress', $bSendEMailAddress);
$mail->assign('fromusername', $fromUser->getUsername());
$mail->assign('fromuserid', $fromUser->getUserId());
$mail->assign('fromuseremail', $fromUser->getEMail());
if ($mail->send()) {
// send copy to fromUser
$mail->assign('copy', true);
$mail->to = $fromUser->getEMail();
$mail->send();
// log
sql("INSERT INTO `email_user` (`ipaddress`, \n\t\t\t `from_user_id`, \n\t\t\t `from_email`, \n\t\t\t `to_user_id`, \n\t\t\t `to_email`)\n\t\t\t VALUES ('&1', '&2', '&3', '&4', '&5')", $_SERVER["REMOTE_ADDR"], $fromUser->getUserId(), $fromUser->getEMail(), $this->getUserId(), $this->getEMail());
return true;
} else {
return false;
}
}
示例10: sendMail
function sendMail($zugangscode, $email)
{
global $p, $vorname, $nachname;
$mail = new mail($email, 'no-reply', $p->t('bewerbung/registration'), $p->t('bewerbung/mailtextHtml'));
$text = $p->t('bewerbung/mailtext', array($vorname, $nachname, $zugangscode));
$mail->setHTMLContent($text);
if (!$mail->send()) {
$msg = '<span class="error">' . $p->t('bewerbung/fehlerBeimSenden') . '</span><br /><a href=' . $_SERVER['PHP_SELF'] . '?method=registration>' . $p->t('bewerbung/zurueckZurAnmeldung') . '</a>';
} else {
$msg = $p->t('global/emailgesendetan') . " {$email}!<br><a href=" . $_SERVER['PHP_SELF'] . ">" . $p->t('bewerbung/zurueckZurAnmeldung') . "</a>";
}
// sende Nachricht an Assistenz
return $msg;
}
示例11: sql_warn
function sql_warn($warnmessage)
{
global $opt;
if ($opt['db']['error']['mail'] != '') {
if (admin_errormail($opt['db']['error']['mail'], $opt['db']['warn']['subject'], $warnmessage . "\n" . print_r(debug_backtrace(), true), "From: " . $opt['mail']['from'])) {
require_once $opt['rootpath'] . 'lib2/mail.class.php';
$mail = new mail();
$mail->name = 'sql_warn';
$mail->subject = $opt['db']['warn']['subject'];
$mail->to = $opt['db']['warn']['mail'];
$mail->assign('warnmessage', $warnmessage);
$mail->assign('trace', print_r(debug_backtrace(), true));
$mail->send();
$mail = null;
}
}
}
示例12: sendBewerbung
function sendBewerbung($prestudent_id)
{
global $person_id;
$person = new person();
$person->load($person_id);
$prestudent = new prestudent();
if (!$prestudent->load($prestudent_id)) {
die('Konnte Prestudent nicht laden');
}
$studiengang = new studiengang();
if (!$studiengang->load($prestudent->studiengang_kz)) {
die('Konnte Studiengang nicht laden');
}
$email = 'Es hat sich ein Student für Ihren Studiengang beworben. <br>';
$email .= 'Name: ' . $person->vorname . ' ' . $person->nachname . '<br>';
$email .= 'Studiengang: ' . $studiengang->bezeichnung . '<br><br>';
$email .= 'Für mehr Details, verwenden Sie die Personenansicht im FAS.';
$mail = new mail($studiengang->email, 'no-reply', 'Bewerbung ' . $person->vorname . ' ' . $person->nachname, 'Bitte sehen Sie sich die Nachricht in HTML Sicht an, um den Link vollständig darzustellen.');
$mail->setHTMLContent($email);
if (!$mail->send()) {
return false;
} else {
return true;
}
}
示例13: sql
$sTopic = sql_value("SELECT `name` FROM `news_topics` WHERE `id`='&1'", '', $topicid);
$tpl->assign('newstopic', $sTopic);
$tpl->assign('newstext', $newstext);
// in DB schreiben
sql("INSERT INTO `news` (`content`, `topic`, `display`) VALUES ('&1', '&2', '&3')", $newstext, $topicid, 0);
$rs = sql("SELECT `email` FROM `user` WHERE `admin`\\&'&1'='&1'", ADMIN_USER);
while ($r = sql_fetch_assoc($rs)) {
// send confirmation
$mail = new mail();
$mail->name = 'newstopic';
$mail->to = $r['email'];
$mail->subject = $translate->t('A newsentry was created on opencaching', '', basename(__FILE__), __LINE__);
$mail->assign('email', $email);
$mail->assign('newstopic', $sTopic);
$mail->assign('newstext', $newstext);
$mail->send();
}
sql_free_result($rs);
// erfolg anzeigen
$tpl->display();
exit;
}
if ($emailok != true) {
$tpl->assign('email_error', 1);
}
if ($captchaok != true) {
$tpl->assign('captcha_error', 1);
}
}
$tpl->assign('newstext', $newstext);
$tpl->assign('newshtml', $newshtml);
示例14: do_edit
/**
* 留言回复
*/
public function do_edit()
{
$request_data = $this->input->post();
if ($_POST) {
//数据验证
$validation = Validation::factory($request_data)->add_rules('message_id', 'required', 'digit')->add_rules('content', 'required', 'length[0,65535]');
if (!$validation->validate()) {
remind::set(Kohana::lang('o_global.input_error'), request::referrer());
}
$message = MessageService::get_instance()->get($request_data['message_id']);
if (empty($message['id'])) {
remind::set(Kohana::lang('o_global.access_denied'), request::referrer(), 'error');
}
$set_data = array('message_id' => $message['id'], 'manager_id' => $this->manager_id, 'content' => $request_data['content'], 'update_timestamp' => date('Y-m-d H:i:s'));
//判断此管理员是否已经回复过
$message_reply_service = Message_replyService::get_instance();
$manager_reply = $message_reply_service->get_reply_by_manager_id($this->manager_id, $message['id']);
if (isset($manager_reply) && !empty($manager_reply['id'])) {
$message_reply_service->set($manager_reply['id'], $set_data);
} else {
$set_data['create_timestamp'] = date('Y-m-d H:i:s');
$message_reply_service->add($set_data);
//把留言的回复状态改为已回复
$message_data['is_reply'] = MessageService::IS_MANAGER_REPLY;
MessageService::get_instance()->set($message['id'], $message_data);
}
//发送邮件
if ($request_data['send_mail'] == '1') {
$email_flag = 'the answer of your question';
$email = $message['email'];
$name = Mymanager::instance($message['manager_id'])->get('name');
$content = '';
$content .= 'Dear ' . $name . ' :<br>';
$content .= $request_data['content'];
if (mail::send($email, $email_flag, $content)) {
remind::set(Kohana::lang('o_global.mail_send_success'));
} else {
remind::set(Kohana::lang('o_global.mail_send_error'), 'manage/message/edit?id=' . $message['id']);
}
}
remind::set(Kohana::lang('o_manage.message_success'), 'manage/message', 'success');
} else {
remind::set(Kohana::lang('o_manage.message_error'), 'manage/message/edit?id=' . $message['id']);
}
}
示例15: sendBestellerMail
/**
* Schickt ein Status-Mail an die Kontaktperson der Bestellung
*
* @param $bestellung Bestellung Object der Bestellung
* @param $status Art der Statusaenderung (bestellt|geliefert|freigabe|storno)
*/
function sendBestellerMail($bestellung, $status)
{
global $date;
$tags = new tags();
$tags->GetTagsByBestellung($bestellung->bestellung_id);
$tagsAusgabe = '';
foreach ($tags->result as $res) {
if ($tagsAusgabe != '') {
$tagsAusgabe .= ', ';
}
$tagsAusgabe .= $res->tag;
}
$msg = '';
$kst_mail = new wawi_kostenstelle();
$kst_mail->load($bestellung->kostenstelle_id);
$firma_mail = new firma();
$firma_mail->load($bestellung->firma_id);
$konto_mail = new wawi_konto();
$konto_mail->load($bestellung->konto_id);
// E-Mail an Kostenstellenverantwortliche senden
$email = "Dies ist eine automatisch generierte E-Mail.<br><br>";
switch ($status) {
case 'bestellt':
$email .= " <b>Ihre Bestellung wurde bestellt</b>";
break;
case 'geliefert':
$email .= " <b>Ihre Bestellung wurde geliefert</b><br>Hinweis: Nach erfolgter Lieferung werden Waren ab einem Wert von EUR 250,-- pro Einzelposition inventarisiert. <br>";
break;
case 'freigabe':
$email .= " <b>Ihre Bestellung wurde freigegeben</b>";
break;
case 'storno':
$email .= " <b>Ihre Bestellung wurde storniert</b>";
break;
}
$email .= "<br>";
$email .= "Kostenstelle: " . $kst_mail->bezeichnung . "<br>";
$email .= "Bestellnummer: " . $bestellung->bestell_nr . "<br>";
$email .= "Titel: " . $bestellung->titel . "<br>";
$email .= "Firma: " . $firma_mail->name . "<br>";
$email .= "Erstellt am: " . $date->formatDatum($bestellung->insertamum, 'd.m.Y') . "<br>";
$email .= "Kostenstelle: " . $kst_mail->bezeichnung . "<br>Konto: " . $konto_mail->kurzbz . "<br>";
$email .= "Tags: " . $tagsAusgabe . "<br>";
$email .= "Link: <a href='" . APP_ROOT . "index.php?content=bestellung.php&method=update&id={$bestellung->bestellung_id}'>zur Bestellung </a>";
$mail = new mail($bestellung->besteller_uid . '@' . DOMAIN, 'no-reply', 'Bestellung ' . $bestellung->bestell_nr, 'Bitte sehen Sie sich die Nachricht in HTML Sicht an, um den Link vollständig darzustellen.');
$mail->setHTMLContent($email);
if (!$mail->send()) {
$msg .= '<span class="error">Fehler beim Senden des Mails</span><br />';
} else {
$msg .= ' Mail verschickt an ' . $bestellung->besteller_uid . '@' . DOMAIN . '!<br>';
}
return $msg;
}