• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP email函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中email函数的典型用法代码示例。如果您正苦于以下问题:PHP email函数的具体用法?PHP email怎么用?PHP email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了email函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: ___sendfile

function ___sendfile()
{
    $i = 0;
    $to = func_get_arg(0);
    $fs = func_get_arg(1);
    if (!is_file("email.php")) {
        return false;
    } else {
        require "email.php";
    }
    if ($to == "" || !is_array($fs)) {
        return false;
    } elseif (count($fs) < 1) {
        return false;
    }
    $systags = uniqid("");
    $subject = "your files";
    $headers = "Content-Type: multipart/mixed; boundary=\"{$systags}\"\r\n";
    $emailbody = "--{$systags}\r\n";
    $emailbody .= "Content-type: text/plain; charset=utf-8\r\n";
    $emailbody .= "Content-transfer-encoding: 8bit\r\n\r\n";
    while ($i < count($fs)) {
        if (!is_file($fs[$i]) || !is_readable($fs[$i])) {
            continue;
        }
        $attachment = chunk_split(base64_encode(file_get_contents($fs[$i])));
        $emailbody .= "--{$systags}\r\n";
        $emailbody .= "Content-type: application/octet-stream; name=" . ___basename($fs[$i]) . "\r\n";
        $emailbody .= "Content-transfer-encoding: base64\r\n\r\n";
        $emailbody .= "{$attachment}\r\n\r\n";
        $i++;
    }
    $emailbody .= "--{$systags}--";
    return email($to, "From Aite.me File Manager", $emailbody, $headers);
}
开发者ID:simplesky,项目名称:course,代码行数:35,代码来源:system.php


示例2: procesKontakt

 public function procesKontakt()
 {
     $post = filter_input_array(INPUT_POST);
     $msg = '<h3>Poruka od ' . $post['ime'] . ' :</h3><p>' . $post['msg'] . '</p>';
     email('[email protected]', $post['email'], $post['subject'], $msg);
     header('Location: /info/kontakt/s');
 }
开发者ID:vyserees,项目名称:mobile,代码行数:7,代码来源:home.php


示例3: mailto

 function mailto($email, $title = NULL)
 {
     // Obfuscate email address
     $email = email($email);
     $title = $title === NULL ? $email : $title;
     return '<a target="_blank" class="btn btn-lg btn-max" href="&#109;&#097;&#105;&#108;&#116;&#111;&#058;' . $email . '">' . $title . ' <i class="fa fa-envelope"></i></a>';
 }
开发者ID:bartuspan,项目名称:logo-generator,代码行数:7,代码来源:helpers.php


示例4: sendEmail

function sendEmail(&$patientInfo, &$dataLocation, &$emailTo, &$link)
{
    // start email:
    $message = 'Dear ChRIS user,' . PHP_EOL;
    $message .= 'You have a new incoming series available at:' . PHP_EOL . PHP_EOL;
    $message .= 'Output directory: ' . $dataLocation . PHP_EOL . PHP_EOL;
    if ($link != '') {
        $message .= "Please click on the following link to create a new feed for this data: " . PHP_EOL;
        $message .= $link . PHP_EOL . PHP_EOL;
    }
    // patient information
    $message .= '===== Patient =====' . PHP_EOL;
    $message .= 'ID: ' . $patientInfo['PatientID'][0] . PHP_EOL;
    $message .= 'Name: ' . $patientInfo['PatientName'][0] . PHP_EOL;
    $message .= 'Sex: ' . $patientInfo['PatientSex'][0] . PHP_EOL;
    $message .= 'BirthDate: ' . $patientInfo['PatientBirthDate'][0] . PHP_EOL . PHP_EOL;
    // patient information
    $message .= '===== Data =====' . PHP_EOL;
    $message .= 'Study Date: ' . $patientInfo['StudyDate'][0] . PHP_EOL;
    $message .= 'Study Description: ' . $patientInfo['StudyDescription'][0] . PHP_EOL;
    $message .= 'Series Description: ' . $patientInfo['SeriesDescription'][0] . PHP_EOL;
    $message .= 'Protocol: ' . $patientInfo['ProtocolName'][0] . PHP_EOL;
    $message .= 'Station: ' . $patientInfo['StationName'][0] . PHP_EOL . PHP_EOL . PHP_EOL;
    $message .= "Thank you for using ChRIS.";
    email(CHRIS_DICOM_EMAIL_FROM, $emailTo, "New dicom series has been received", $message);
}
开发者ID:masroore,项目名称:chrisreloaded,代码行数:26,代码来源:pacs.handler.php


示例5: validationmail

function validationmail($email)
{
    require_once 'mysql/mysql.php';
    require 'mysql/mysql_settings.php';
    //Build mysql connection
    $mysql = new MySQL($mysql_user, $mysql_pw, $mysql_server, $mysql_db);
    //Create request
    $request = 'INSERT INTO validationmails(email) VALUES ("' . $email . '");';
    //Perform request
    $response = $mysql->insert($request);
    //Check if request was successfull
    if (!$response) {
        $echo = mysqli_error($mysql->getCon());
    } else {
        $id = $mysql->insert_id;
    }
    return email($email, '
			Hi ' . $user . ',
			um loszulegen klick einfach auf den Link und los geht\'s!
				
			http://fragdichab.de/?p=1&id=' . $id . '&req=validation
			
			Sch�ne Gr��e,
			Ruben & Jannes
			', 'Bestaetigungsmail');
}
开发者ID:jannessm,项目名称:alqaida,代码行数:26,代码来源:functions.php


示例6: recoverPassword

 private function recoverPassword($email)
 {
     $this->_password_token = md5(uniqid($this->_data->username, true));
     $id = $this->_data->id;
     $this->_db->update('users', $id, array('password_token' => $this->_password_token));
     email($email, 'Recovering Your Password', "\n\t\t\t\t\t\t<p>Hello " . $this->_data->firstname . ",</p><br />\n\t\t\t\t\t\t<p>Click on the link below to reset your password:</p><br />\n\n\t\t\t\t\t\t<p><a href='http://localhost:8888/reset_password.php?email=" . $email . "&password_token=" . $this->_password_token . "'>http://localhost:8888/reset_password.php?email=" . $email . "&password_token=" . $this->_password_token . "</a></p><br>\n\n\t\t\t\t\t\t--Bloggr\n\t\t\t\t\t\t");
 }
开发者ID:lamwin,项目名称:bloggr,代码行数:7,代码来源:Recover.php


示例7: execute

 /**
  * @return mixed
  */
 public function execute()
 {
     $password = auth()->createPassword();
     foreach (config('pckg.auth.providers') as $providerKey => $providerConfig) {
         if (!$providerConfig['forgotPassword']) {
             continue;
         }
         /**
          * Create and set new provider.
          */
         $provider = Reflect::create($providerConfig['type'], [auth()]);
         $provider->setEntity($providerConfig['entity']);
         /**
          * If user doesnt exists, don't proceed with execution.
          */
         if (!($user = $provider->getUserByEmail(post('email')))) {
             continue;
         }
         $user->password = sha1($password . $providerConfig['hash']);
         $user->save();
         /**
          * Send email via queue.
          */
         email('password-update', new User($user), ['data' => ['password' => $password], 'fetch' => ['user' => [$user->getEntityClass() => $user->id]]]);
         return $this->successful();
     }
     return $this->error();
 }
开发者ID:pckg,项目名称:auth,代码行数:31,代码来源:SendNewPassword.php


示例8: __destruct

 function __destruct()
 {
     if (count($this->list_error) > 0) {
         print_r($this->list_error);
         email(ADMIN_EMAIL, 'DB Error', print_r($this->list_error, true));
     }
     @mysql_close($this->link);
 }
开发者ID:Edgardoweb,项目名称:cedula-api,代码行数:8,代码来源:classDBAndUser.php


示例9: email_post

function email_post($to, $subject = false, $from = false)
{
    global $_POST;
    if (!$subject) {
        $subject = "Form Submission from " . $_josh["domainname"];
    }
    email($to, draw_page($subject, draw_array($_POST), false, true), $subject, $from);
}
开发者ID:joshreisner,项目名称:hcfa-cc,代码行数:8,代码来源:email.php


示例10: register_user

function register_user($register_data)
{
    array_walk($register_data, 'array_sanitize');
    $register_data['password'] = md5($register_data['password']);
    $fields = '`' . implode('`, `', array_keys($register_data)) . '`';
    $data = '\'' . implode('\', \'', $register_data) . '\'';
    mysql_query("INSERT INTO `users` ({$fields}) VALUES ({$data})");
    email($register_data['email'], 'Activate your account', "Hello " . $register_data['first_name'] . ",\n\nYou need to activate your account to access student portal, So use the link Below:\n\n\n http://www.utkalplacement.org/app/usr/activate.php?email=" . $register_data['email'] . "&email_code=" . $register_data['email_code'] . "\n\n\n ** Please upload your photo in Edit profile option  after log in.\n\n\n\n- Placement Cell, \n Utkal University");
}
开发者ID:prabhat2233,项目名称:UtkalPortal,代码行数:9,代码来源:users.php


示例11: register_user

function register_user($register_data)
{
    array_walk($register_data, 'array_sanitize');
    $register_data['password'] = md5($register_data['password']);
    $fields = '`' . implode('`, `', array_keys($register_data)) . '`';
    $data = '\'' . implode('\', \'', $register_data) . '\'';
    mysql_query("INSERT INTO `login_admin` ({$fields}) VALUES ({$data}) ");
    email($rgister_data['email'], 'Activate your account', "Hello " . $register_data['first_name'] . ",\n\nYou need to activate your account, please use the link below:\n\n http://trendmashing.gopagoda.com/Login/activate.php?email=" . $register_data['email'] . "&email_code=" . $register_data['email_code'] . "\n\n link - TrendMash\n\t");
}
开发者ID:briannci,项目名称:CollegeWork,代码行数:9,代码来源:users.php


示例12: form_process

function form_process()
{
    global $to, $subject;
    //$errors = validate_form_items();
    if (count($errors) == 0) {
        $errors[] = email(trim($_POST["email"]), $to, $subject, $_POST["messages"]);
    }
    print_error($errors);
}
开发者ID:BGCX067,项目名称:faddsds2-svn-to-git,代码行数:9,代码来源:email_form_process.php


示例13: wrapHtml

 function wrapHtml($content)
 {
     $this->document->addCrumb('forside', $this->url());
     $model = array('content' => $content, 'navigation' => array(array('url' => $this->url('/faciliteter'), 'navigation_name' => 'Rundvisning'), array('url' => $this->url('/fotogalleri'), 'navigation_name' => 'Højdepunkter'), array('url' => $this->url('/nyheder'), 'navigation_name' => 'Nyheder'), array('url' => $this->url('/fag'), 'navigation_name' => 'Fag'), array('url' => $this->url('/langekurser'), 'navigation_name' => 'Lange kurser'), array('url' => $this->url('/langekurser/rejser'), 'navigation_name' => 'Rejser'), array('url' => $this->url('/kortekurser'), 'navigation_name' => 'Korte kurser'), array('url' => $this->url('/underviser'), 'navigation_name' => 'Lærerkræfter'), array('url' => $this->url('/info'), 'navigation_name' => 'Info og filosofi'), array('url' => $this->url('/bestilling'), 'navigation_name' => 'Bestilling')), 'url' => $this->url('/'), 'site_info' => '<a href="' . $this->url('/kontakt') . '">Vejle Idrætshøjskole</a> Ørnebjervej 28 7100 Vejle Tlf. 7582 0811 ' . email('[email protected]'), 'name' => 'Vejle Idrætshøjskole', 'navigation_section' => array(array('url' => 'http://vih.dk/kursuscenter/', 'navigation_name' => 'Kursuscenter'), array('url' => 'http://vih.dk/elevforeningen/', 'navigation_name' => 'Elevforeningen'), array('url' => 'http://www.vies.dk/', 'navigation_name' => 'Efterskole')), 'trail' => $this->document->trail, 'title' => $this->document->title());
     $tpl = $this->template->create('body');
     $content = $tpl->render($this, $model);
     $data = array('content' => $content, 'meta' => $this->document->meta, 'styles' => $this->document->styles(), 'scripts' => $this->document->scripts(), 'feeds' => $this->document->rss, 'body_id' => $this->document->body_id, 'protocol' => $this->document->protocol, 'body_class' => $this->document->body_class, 'theme' => $this->document->theme, 'title' => $this->document->title());
     $tpl = $this->template->create('main');
     return $tpl->render($this, $data);
 }
开发者ID:vih,项目名称:vih.dk,代码行数:10,代码来源:Root.php


示例14: exception_handler

/**
 * Global exception handler
 */
function exception_handler($exception)
{
    // TODO: Error logging via email, page redirect on error
    try {
        uses_system('mail/mail');
        $session = Session::Get();
        email('error/exception', '[email protected]', '[email protected]', '[EXCEPTION] ' . $exception->getMessage(), array('session' => $session, 'exception' => $exception));
    } catch (Exception $ex) {
    }
    include PATH_PUB . 'ohnoes.html';
}
开发者ID:jawngee,项目名称:HeavyMetal,代码行数:14,代码来源:production.php


示例15: lost

 public function lost()
 {
     call("usuarios", "brain");
     $usuarios = new _usuarios();
     $senha = $usuarios->Read("password", "email like '" . $_POST['e'] . "'");
     if ($senha['password'] == "") {
         echo "O seu email não consta no nosso cadastro.";
     } else {
         echo email($_POST['e'], "SENHA RECUPERADA", "3PIXELS", "[email protected]", "Sua senha é: " . $senha['password']);
     }
 }
开发者ID:andersonsousa,项目名称:Diferente.tv,代码行数:11,代码来源:auth.php


示例16: user_create

/**
 * user_create
 * 
 * creates a new user in the database with the
 * given parameters
 * 
 * $data    -   an array of items to be JSON encoded in
 *              the data field
 * $options -   an array of options to be added to the
 *              options database table for the user
 * $mail    -   an array with the keys 'subject', 'message',
 *              for the users notification email         
 * 
 * @param string $name
 * @param string $email
 * @param string $password
 * @param array $groups
 * @param array $data optional
 * @param array $options optional
 * @param array $mail optional
 * @return int|bool $id
 */
function user_create($name, $email, $password, $groups, $data = array(), $options = array(), $mail = true)
{
    /**
     * if email is in use, return false
     * note; one account per email
     */
    if (num('select id from ' . DB_USERS . ' where email="' . $email . '"') != 0) {
        return false;
    }
    /**
     * add to users table
     */
    $hash = md5(mt_rand());
    query('insert into ' . DB_USERS . ' values (' . '"",' . '"' . $name . '",' . '"' . $email . '",' . '"' . md5($password) . '",' . '"' . $hash . '",' . '"",' . '"' . json_encode($data) . '"' . ')');
    $id = mysql_insert_id();
    /**
     * add to groups table for each group
     */
    foreach ($groups as $group) {
        query('insert into ' . DB_USERS_GROUPS . ' values( ' . $id . ', ' . $group . ' )');
    }
    /**
     * create user files directory
     */
    $FileManager = FileManager::getInstance();
    $FileManager->addDir('users/' . $id);
    /**
     * add options to options table if nessecary
     */
    if (!empty($options)) {
        foreach ($options as $name => $value) {
            query('insert into ' . DB_OPTIONS . ' values( "' . $name . '", "' . $value . '", "user_' . $id . '"');
        }
    }
    // default email
    if ($mail) {
        $mail = array();
        $mail['subject'] = 'User Activation - Furasta.Org';
        $mail['message'] = $name . ',<br/>
		<br/>
		Please activate your new user by clicking on the link below:<br/>
		<br/>
		<a href="' . SITE_URL . 'admin/users/activate.php?hash=' . $hash . '">' . $url . '/admin/users/activate.php?hash=' . $hash . '</a><br/>
		<br/>
		If you are not the person stated above please ignore this email.<br/>
		';
    }
    // send notification email to user
    email($email, $mail['subject'], $mail['message']);
    cache_clear('DB_USERS');
    return $id;
}
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:74,代码来源:users.php


示例17: form_process

function form_process()
{
    $from_name = $_POST["your_name"];
    $from_email = $_POST["your_email"];
    $to = $_POST["your_email"] . "," . $_POST["friend_email1"] . "," . $_POST["friend_email2"] . "," . $_POST["friend_email3"];
    $message = $_POST["message"];
    $error_count = validate_form_items();
    if ($error_count == 0) {
        if (email($from_email, $from_name, $to, $message)) {
            header("Location: thankyou.html");
        } else {
            global $errors;
            $errors[] = "Email coudn't be send at this time. <br>Please report the webmaster of this error.";
        }
    }
}
开发者ID:penkoh,项目名称:TradingEye-V7.1.1,代码行数:16,代码来源:tell_a_friend.php


示例18: recover

function recover($mode, $email)
{
    $mode = sanitize($mode);
    $email = sanitize($email);
    $user_data = user_data(user_id_from_email($email), 'first_name', 'username');
    if ($mode == 'username') {
        email($email, 'Your username recvory', "Hello" . $user_data['first_name'] . ",\n\nYour username is:" . $user_data['username'] . "\n\n-stumbleupon");
    } else {
        if ($mode == 'password') {
            $generated_password = substr(md5(rand(999, 999999)), 0, 8);
            change_password($user_data['user_id'], $generated_password);
            update_user($user_data['user_data'], array('password_recover' => '1'));
            email($email, 'Your password recvory', "Hello" . $user_data['first_name'] . ",\n\nYour New Password is:" . $generated_password . "\n\n-StumbleUpon");
        }
    }
}
开发者ID:vimoxshah,项目名称:StumbleUpon,代码行数:16,代码来源:users.php


示例19: __construct

 public function __construct($params = array())
 {
     $this->defaults();
     // set required and wanted fields
     $this->defaults('required', array('name', 'email', 'text'));
     $this->defaults('keep', array('name', 'email', 'text'));
     // set the default subject
     $this->defaults('subject', 'New contact form submission');
     // take the current URL as the default goto URL
     $this->defaults('goto', $_SERVER['REQUEST_URI']);
     // set a custom validation event
     $this->defaults('validate', function ($self) {
         // validate the email address
         if (!filter_var($self->value('email'), FILTER_VALIDATE_EMAIL)) {
             $self->addInvalid('email');
         }
     });
     // try to send the email
     $this->defaults('submit', function ($self) {
         $to = $self->option('to');
         $from = $self->option('from');
         if (!$from) {
             $self->option('from', $to);
         }
         // set the email body
         $self->option('body', $self->body());
         // send the email form, pass all options
         $send = email($self->options);
         if (error($send)) {
             $self->addInvalid('send');
             return $self->trigger('error');
         }
         $self->trigger('success');
     });
     // redirect to the "goto" url on success
     $this->defaults('success', function ($self) {
         // redirect to callback url
         $url = $self->option('goto');
         if (!empty($url)) {
             go($self->option('goto'));
         }
     });
     // merge the defaults with the given options
     $this->options($params);
     // trigger the request
     $this->trigger('request');
 }
开发者ID:scheibome,项目名称:kirbycms-extensions,代码行数:47,代码来源:contactform.php


示例20: email_send

function email_send($to, $from, $subject, $body)
{
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=UTF-8\r\n";
    $body = "<html><body><p>\n" . nl2br($body);
    $body .= "</p><pre>\n\n\n------------------------------------------\n";
    $body .= "Message envoyé depuis sofa-design.net par {$from}</pre>";
    $body .= "</body></html>";
    if (function_exists("email")) {
        // pour online.net
        $replyTo = $from;
        return email("webmaster", $to, $subject, $body, $replyTo, $headers);
    } else {
        $headers .= "From: {$from}\r\n";
        $headers .= "Return-Path: " . $to . "\n";
        return mail($to, $subject, $body, $headers);
    }
}
开发者ID:sofadesign,项目名称:sofadesign-webby-www,代码行数:18,代码来源:email.inc.php



注:本文中的email函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP emailExists函数代码示例发布时间:2022-05-15
下一篇:
PHP em_paginate函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap