Ejemplo n.º 1
0
                    require $config['BASE_DIR'] . '/classes/file.class.php';
                    $subject = $rs->fields['email_subject'];
                    $path = $config['BASE_DIR'] . '/templates/' . $rs->fields['email_path'];
                    $body = VFile::read($path);
                    $search = array('{$site_name}', '{$video_url}', '{$message}');
                    $replace = array($config['site_name'], $video_url, $message);
                    $body = str_replace($search, $replace, $body);
                    $mail = new VMail();
                    $mail->From = $from;
                    $mail->FromName = $from;
                    $mail->Sender = $from;
                    $mail->AddReplyTo($from);
                    $mail->Subject = $subject;
                    $mail->AltBody = $body;
                    $mail->Body = nl2br($body);
                    $mail->AddAddress($to);
                    $mail->Send();
                }
            }
        }
    }
}
if (defined('_DEBUG') && _DEBUG) {
    echo var_dump($body) . '<br>';
    ?>
<html>
<head>
	<title>Testing Player Email</title>
</head>
<body>
<form name="sendPlayerEmail" method="post" action="<?php 
Ejemplo n.º 2
0
            } else {
                $errors[] = 'Username does not exist!';
            }
        }
    }
    if ($subject == '') {
        $errors[] = 'Subject field cannot be empty!';
    } elseif ($message == '') {
        $errors[] = 'Email message cannot be empty!';
    }
    if (!$errors) {
        $mail = new VMail();
        $mail->set();
        $mail->Subject = $subject;
        $mail->AltBody = $message;
        $mail->Body = nl2br($message);
        $mail->AddAddress($rs->fields['email']);
        if ($mail->Send()) {
            $messages[] = 'Email was successfuly sent to <b>' . $username . '</b>!';
        } else {
            $errors[] = 'Failed to send email! Please check your <a href="index.php?m=mail">Mail Settings</a> and make sure the provided email is valid!';
        }
    }
}
$htmlCode = isset($_POST['htmlCode']) ? trim($_POST['htmlCode']) : NULL;
$editor->set_code($htmlCode);
$smarty->assign('email', $email);
$smarty->assign('username', $username);
$smarty->assign('specific', $specific);
$smarty->assign('subject', $subject);
$smarty->assign('editor_wp', $editor->return_editor('100%', 350));
Ejemplo n.º 3
0
    if ($_SESSION['captcha_code'] != strtoupper($code)) {
        $errors[] = $lang['global.verif_invalid'];
        $err['captcha'] = 1;
    }
    if (!$errors) {
        require $config['BASE_DIR'] . '/classes/email.class.php';
        $message = "Department: " . $department . "\n\nMessage: " . $message;
        $mail = new VMail();
        $mail->From = $email;
        $mail->FromName = $name;
        $mail->Sender = $email;
        $mail->AddReplyTo($email, $name);
        $mail->Subject = 'Feedback from ' . htmlspecialchars($name);
        $mail->AltBody = $message;
        $mail->Body = nl2br($message);
        $mail->AddAddress($config['admin_email']);
        $mail->Send();
        $messages[] = $lang['feedback.sent'];
    }
}
$smarty->assign('errors', $errors);
$smarty->assign('err', $err);
$smarty->assign('messages', $messages);
$smarty->assign('menu', 'home');
$smarty->assign('feedback', $feedback);
$smarty->assign('self_title', $seo['feedback_title']);
$smarty->assign('self_description', $seo['feedback_desc']);
$smarty->assign('self_keywords', $seo['feedback_keywords']);
$smarty->display('header.tpl');
$smarty->display('errors.tpl');
$smarty->display('messages.tpl');
Ejemplo n.º 4
0
        $username = $rs->fields['username'];
        $sql = "UPDATE signup SET pwd = '" . mysql_real_escape_string($password) . "'\n                       WHERE username = '******' LIMIT 1";
        $conn->execute($sql);
        $smarty->assign('receiver_name', $username);
        $smarty->assign('password', $passwd);
        $sql = "SELECT * FROM emailinfo WHERE email_id = 'recover_password' LIMIT 1";
        $rs = $conn->execute($sql);
        $subject = str_replace('{$site_name}', $config['site_name'], $rs->fields['email_subject']);
        $email_path = $config['BASE_DIR'] . '/templates/' . $rs->fields['email_path'];
        $body = $smarty->fetch($email_path);
        $mail = new VMail();
        $mail->set();
        $mail->Subject = $subject;
        $mail->AltBody = $body;
        $mail->Body = nl2br($body);
        $mail->AddAddress($email);
        $mail->Send();
        $messages[] = $lang['lost.msg'];
    }
}
$smarty->assign('errors', $errors);
$smarty->assign('messages', $messages);
$smarty->assign('menu', 'home');
$smarty->assign('self_title', $seo['lost_title']);
$smarty->assign('self_description', $seo['lost_desc']);
$smarty->assign('self_keywords', $seo['lost_keywords']);
$smarty->display('header.tpl');
$smarty->display('errors.tpl');
$smarty->display('messages.tpl');
$smarty->display('lost.tpl');
$smarty->display('footer.tpl');
Ejemplo n.º 5
0
     $subscribers = $rs->getrows();
     $mail = new VMail();
     $mail->setNoReply();
     $sql = "SELECT * FROM emailinfo WHERE email_id = 'subscribe_email' LIMIT 1";
     $rs = $conn->execute($sql);
     $email_path = $config['BASE_DIR'] . '/templates/' . $rs->fields['email_path'];
     $sender = $anonymous == 'yes' ? 'anonymous' : $_SESSION['username'];
     $mail->Subject = str_replace('$sender_name', $sender, $rs->fields['email_subject']);
     foreach ($subscribers as $subscriber) {
         $smarty->assign('video_link', $video_link);
         $smarty->assign('username', $subscriber['username']);
         $smarty->assign('sender_name', $_SESSION['username']);
         $body = $smarty->fetch($email_path);
         $mail->AltBody = $body;
         $mail->Body = nl2br($body);
         $mail->AddAddress($subscriber['email']);
         $mail->Send();
         $mail->ClearAddresses();
     }
 }
 $search = array('{$site_title}', '{$site_name}', '{$username}', '{$video_link}', '{$baseurl}');
 $replace = array($config['site_title'], $config['site_name'], $_SESSION['username'], $video_link, $config['BASE_URL']);
 $mail = new VMail();
 if ($config['approve'] == '0') {
     $mail->sendPredefined($_SESSION['email'], 'video_approve', $search, $replace);
 } else {
     $mail->sendPredefined($_SESSION['email'], 'video_upload', $search, $replace);
 }
 $sql = "UPDATE channel SET total_videos = total_videos+1 WHERE CHID = " . $category . " LIMIT 1";
 $conn->execute($sql);
 $sql = "UPDATE signup SET total_videos = total_videos+1, points = points+10 WHERE UID = " . $uid . " LIMIT 1";