<?
include_once("./_common.php");

if (!$config[cf_email_use])
    alert("尚未开启邮件功能！请查看公告或联系管理员！");

if (!$is_member && $config[cf_formmail_is_member])  
    alert_close("需要登录后才能正常使用！");

if ($is_member && !$member[mb_open] && $is_admin != "super" && $member[mb_id] != $mb_id) 
    alert_close("如果您不公开个人信息就不可以像其他会员发送短信！\\n\\n公开与否可以在账号管理中设置");

if ($mb_id) 
{
    $mb = get_member($mb_id);
    if (!$mb[mb_id]) 
        alert_close("会员账户输入有误或已注销的账户\\n\\n请确认后重新输入！");

    if (!$mb[mb_open] && $is_admin != "super")
        alert_close("尚未公开个人资料！");
}

$sendmail_count = (int)get_session('ss_sendmail_count') + 1;
if ($sendmail_count > 3)
    alert_close('您发送的邮件已超过规定数量！\n\n如果需要继续使用请重新登录');

$g4[title] = "编辑邮件";
include_once("$g4[path]/head.sub.php");

if (!$name)
    $name = base64_decode($email);

if (!isset($type)) 
    $type = 0;

$type_checked[0] = $type_checked[1] = $type_checked[2] = "";
$type_checked[$type] = "checked";

$member_skin_path = "$g4[path]/skin/member/$config[cf_member_skin]";
include_once("$member_skin_path/formmail.skin.php");

include_once("$g4[path]/tail.sub.php");
?>
