Tôi biết câu hỏi này là cũ, nhưng tôi đã có một vấn đề tương tự, đạt đến giới hạn khi tôi cần gửi email cho nhiều người nhận.
Tôi đã xem qua solution này, nhưng tôi không hiểu tại sao nó hoạt động, tôi để nó ở đây anyway
function sendEmails(emails) {
var timeout = 2000;
var mailtoPrefix = 'mailto:?bcc=';
var maxUrlCharacters = 1900;
var separator = ';';
var currentIndex = 0;
var nextIndex = 0;
if (emails.length < maxUrlCharacters) {
window.location = mailtoPrefix + emails;
return;
}
do {
currentIndex = nextIndex;
nextIndex = emails.indexOf(separator, currentIndex + 1);
} while (nextIndex != -1 && nextIndex < maxUrlCharacters)
if (currentIndex == -1) {
window.location = mailtoPrefix + emails;
} else {
window.location = mailtoPrefix + emails.slice(0, currentIndex);
setTimeout(function() {
sendEmails(emails.slice(currentIndex + 1));
}, timeout);
}
}
sử dụng:
var emails = '[email protected];[email protected];[email protected]';
sendEmails(emails);
Tôi không muốn gửi email thông báo. Tôi muốn nó hoạt động giống như một liên kết mailto thông thường, nơi người dùng có thể gửi email qua ứng dụng thư khách của họ. – HyderA
@gAMBOOKa Tôi hiểu. Bạn có thể không may mắn cho điều đó ... Có thể gửi một liên kết đến thông tin thay thế? –
Có, tôi đoán một đoạn trích và một liên kết sẽ phải làm. Cảm ơn! – HyderA