0

Does anyone knows what is wrong with this code? I'm trying to send a information comingo from a modal form to a mail that the modal form ask.

Here is the code:

function sendEmail() {

Email.send({
     Host: "smtp.host.email",
     Username : "user@domain.com",
     Password : "password",
     To : console.log('email: '+ inputEmail.value),
     From : "user@domain.com",
     Subject : subject,
     Body : let results = {

  Digestivo: calculateResultInWords(result.D),

  Cardiovascular: calculateResultInWords(result.I),

  'Salud General': calculateResultInWords(result.C),

  Nervioso: calculateResultInWords(result.N),

  Inmunológico: calculateResultInWords(result.M),

  Respiratorio: calculateResultInWords(result.R),

  Urinario: calculateResultInWords(result.U),

  Endócrino: calculateResultInWords(result.G),

  Estructural: calculateResultInWords(result.E)

};,
     
     }).then(
     )
     });

I'm trying to send the mail with the result of the form in the body of the mail and to the mail the customer has provided.

Progman
  • 16,827
  • 6
  • 33
  • 48
  • First thing that jumps to the eye: `To : console.log('email: '+ inputEmail.value)` sets the recipient to return value of `console.log` (which is void, ie nothing) ... Second thing `Body : let results = { ... } ` how does that not throw a myriad of errors in the console? – derpirscher Aug 20 '23 at 15:55
  • What is the error? You can open the Console/Network tab in the Developer tool to capture the error. – xwlee Aug 20 '23 at 15:58

0 Answers0