-2
Good morning to all, I am developing an extremely simple e-mail sending system using javascript (Jquery).
I can already send the email using smtpjs. the first part of my system is OK.
However I would like to attach in the email some spreadsheets in Excel, I have tried some procedures and could not.
Follows current code:
$('#enviar').on('click',function(e){
e.preventDefault()
var email = $('#email').val()
var titulo =$('#titulo').val()
var corpo =$('#corpo').val()
Email.send({
To : email,
From : "[email protected]",
Subject : titulo,
Body :corpo
}).then(message => alert(message))
})
<div class="row">
<form class="col-12">
<div class="form-group">
<label for="email">Email </label>
<input type="text" class="form-control" id="email" aria-describedby="Digite o email de destino">
</div>
<div class="form-group">
<label for="titulo">Titulo do Email</label>
<input type="text" class="form-control" id="titulo">
</div>
<div class="form-group">
<label for="corpo">Corpo do email</label>
<textarea class="form-control" id="corpo" rows="3"></textarea>
</div>
<div class="form-group">
<label for="inp">Enviar Arquivo</label>
<input type="file" class="form-control-file" id="input">
</div>
<button id="enviar" class="btn btn-primary">Enviar</button>
</form>
</div>
But it’s good to explain what was done because it can help someone in the future, and not just put the code.
– Sam