I am trying send email to all user present in DB, I just need to open outlook prompt with the loaded data of emails and Bcc & CC, then user can verify and add points he wants to send then send it.
let EmailTo = "";
try {
const GetEmail = await fetch("http://127.0.0.1:8000/XXX/XXX");
const data = await GetEmail.json();
console.log("the data avalue");
console.log(data);
const Email_Data = data;
console.log(Email_Data);
Email_Data.forEach((email) => {
EmailTo = EmailTo + email.XXX;
});
} catch (err) {
swal({
title: "Error Fetching Email",
text: "Error occured while fetching the emails..",
buttons: "Ok",
closeOnClickOutside: true,
});
}
const EmailCC = "XXXX";
const Body = "XXXX";
const Bcc = "XXXXX";
console.log("email function");
window.open(
"mailto:" +
EmailTo +
"&cc=" +
EmailCC +
"&bcc=" +
Bcc +
"&subject=XXXXX&body=" +
Body
);
};
New contributor
user23154524 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.