I am using Mailto to send a mail from react.
import React from "react";
import ReactDOM from "react-dom";
import "./styles.css";
function Mailto({ email, subject, body, ...props }) {
return (
<a href={`mailto:${email}?subject=${subject || ""}&body=${body || ""}`}>
{props.children}
</a>
);
}
ReactDOM.render(
<Mailto email="sample@gmail.com" subject="Working" body="Hey there !">
Mail me!
</Mailto>,
document.getElementById("root")
);
But this function triggers a draft mail and it is storing in the draft of sender mailbox. I have to go inside the draft box and send the mail for it to go to reciever.
Is that the functionality of Mailto or am i missing something?