/通过登录qq邮箱获取Sid码发邮件,sid码有效期最大为一个月,只要qq不在其它网页登录
缺点是要qq密码
/

mail("", "", "2192003656@qq.com");
//函数可以直接调用,账号密码和邮箱必须写

function mail(账号, 密码, 邮箱, 标题, 内容) {
var js = engines.execScript("", ""ui";mail0("" + 账号 + "","" + 密码 + "","" + 邮箱 + "","" + 标题 + "","" + 内容 + "");" + mail0);
function mail0(账号, 密码, 邮箱, 标题, 内容) {

ui.layout(
<vertical>
<webview id="webview" alpha="0" h="1px"/>
<horizontal h="*" gravity="center_horizontal|center_vertical">
<progressbar/>
<text text="发送中…"/>
</horizontal>
</vertical>
);

setTimeout(function(){
toast("连接超时");
ui.finish();
}, 30000);
//检查是否超时

var storage = storages.create("Sid");
var uin = storage.get("uin");
var password = storage.get("password");
if (账号 == uin && 密码 == password) {
var sid = storage.get("sid");
if (sid == "undefined") sid = "sid=重新登陆";
} else {
storage.clear();
storage.put("uin", 账号);
storage.put("password", 密码);
var sid = "sid=重新登陆";
threads.start(function() {
ui.run(()=>{
ui.webview.loadUrl("https://w.mail.qq.com/cgi-bin/ftnExs_files?fromsidebar=1&"+sid+"&up=down&t=exs_ftn_files&list=0");
});
desc("退出").click();
js;
ui.finish();
});
}
//读取sid码,判断账号是否改变

threads.start(function() {
log("https://w.mail.qq.com/cgi-bin/mobile?" + sid + "&t=phone#compose");
a();
function a() {
ui.run(() => {
ui.webview.loadUrl("https://w.mail.qq.com/cgi-bin/mobile?" + sid + "&t=phone#compose");
});

if (desc("收件人:").findOne(2000)) {
desc("收件人:").setText(邮箱);
desc("请输入邮件内容...").setText(内容);
desc("").setText(标题);
desc("发送").click();
}//发邮件

if (desc("QQ邮箱,你能发现更多").findOne(3000)) {
toast("发送成功");
ui.finish();
} else {
ui.run(() => {
ui.webview.loadUrl("https://ui.ptlogin2.qq.com/cgi-bin/login?style=9&appid=522005705&daid=4&s_url=https%3A%2F%2Fw.mail.qq.com%2Fcgi-bin%2Flogin%3Fvt%3Dpassport%26vm%3Dwsk%26delegate_url%3D%26f%3Dxhtml%26target%3D&hln_css=http%3A%2F%2Fmail.qq.com%2Fzh_CN%2Fhtmledition%2Fimages%2Flogo%2Fqqmail%2Fqqmail_logo_default_200h.png&low_login=1&hln_autologin=记住登录状态&pt_no_onekey=1&uin=" +
账号);
});
if (desc("登 录").findOne()) {
desc("").text("").setText("\n");
sleep(200);
engines.execScript("", "Text("" + 密码 + "");KeyCode(66);");
//登录qq邮箱
if (desc("中转站 ").findOne(5000)) {
desc("中转站 ").click();
sid = descStartsWith("readtemplate?sid=").findOne().contentDescription;
sid = String(sid).match("sid=.{0,150}");
storage.put("sid", sid);
//获取sid码
}
}
a();
}
}
});
}
return true;
}