$CONTENT = td_iconv(htmlspecialchars($CONTENT), "utf-8", MYOA_CHARSET); $EXCONTENT = td_iconv($EXCONTENT, "utf-8", MYOA_CHARSET); $CONTENT .= $EXCONTENT; $SEND_TIME = time(); if ($WEBMAIL != "") { $query = "SELECT * from WEBMAIL where USER_ID='" . $_SESSION['LOGIN_USER_ID'] . "' and EMAIL_PASS!='' limit 1"; $cursor = exequery(TD::conn(), $query); if ($ROW = mysql_fetch_array($cursor)) { $EMAIL = $ROW['EMAIL']; $SMTP_SERVER = $ROW['SMTP_SERVER']; $LOGIN_TYPE = $ROW['LOGIN_TYPE']; $SMTP_PASS = $ROW['SMTP_PASS']; $SMTP_PORT = $ROW['SMTP_PORT']; $SMTP_SSL = $ROW['SMTP_SSL'] == "1" ? "ssl" : ""; $EMAIL_PASS = $ROW['EMAIL_PASS']; $EMAIL_PASS = td_authcode($EMAIL_PASS, "DECODE"); if ($LOGIN_TYPE == "1") { $SMTP_USER = substr($EMAIL, 0, strpos($EMAIL, "@")); } else { $SMTP_USER = $EMAIL; } if ($SMTP_PASS == "yes") { $SMTP_PASS = $EMAIL_PASS; } else { $SMTP_PASS = ""; } $result = send_mail($EMAIL, $WEBMAIL, $SUBJECT, $CONTENT, $SMTP_SERVER, $SMTP_USER, $SMTP_PASS, TRUE, $_SESSION['LOGIN_USER_NAME'], $REPLY_TO, $CC, $BCC, $ATTACHMENT, TRUE, $SMTP_PORT, $SMTP_SSL); if ($result === TRUE) { echo _("外部邮件发送成功"); exit; }
public function buildAttachUrl($attach_url, $agentid) { $code = "fromWX_" . $agentid; $state = td_authcode($code, "ENCODE", "weixinqy"); return $attach_url . "&state=" . $state; }