0

I have an email component made in react, but I want to have its body text on different lines.

Here's the component:

export const Mailto = ({ email, subject = '', body = '', children }) => 
{
    let params = subject || body ? '?' : '';
    if (subject) params += `subject=${encodeURIComponent(subject)}`;
    if (body) params += `${subject ? '&' : ''}body=${encodeURIComponent(body)}`;

    return <a href={`mailto:${email}${params}`}>{children}</a>;
};
isherwood
  • 52,576
  • 15
  • 105
  • 143
  • 1
    Does this answer your question? [Insert a line break in mailto body](https://stackoverflow.com/questions/22765834/insert-a-line-break-in-mailto-body) – T.Trassoudaine Nov 03 '21 at 13:49

0 Answers0