// 获取当前活动表格 const activeSheet = ActiveSheet // 获取当前表格的使用区域 const usedRange = activeSheet.UsedRange
// 将使用区域中的数据复制到剪贴板 usedRange.Copy()
// 邮件发送器
let mailer = SMTP.login({
host: "smtp.163.com", // 邮件服务器域名
port: 465, // 邮件服务器端口
secure: true, // 使用TLS加密传输
username: "xxxxxxx@163.com", // 发送邮件的账户名
password: "xxxxxxx" // 发送邮件的账户密码
})
// 发送邮件
mailer.send({
from: "xxxxx@163.com", // 发件人邮箱地址
to: "xxxxxxx@163.com", // 收件人邮箱地址
subject: "日报表内容", // 邮件主题
text: usedRange.Value2 // 邮件正文
})
// 清空使用区域的内容 usedRange.ClearContents()