Is it possible to send an e-mail with attachment in Office 365? As attachment we would want the attachment from a list item or local system or a document from a document library.
I tried using a SMTP server in a custom webpart (which failed because SMTP isn't allowed)
Is this solution possible?
I had written below code for send by mail.
$(document).on('click',"button[data-automation-id='sendByEmailDialogSendButton']", function (event) {
loadScript("https://smtpjs.com/v3/smtp.js", function(){
debugger;
Email.send({
SecureToken: "35c2dcb7-b282-47ce-b894-4fe52a3f071a",
Host : "smtp.gmail.com",
port:"587",
EnableSsl :false,
Username : "Gmail Username",
Password : "password",
To : 'SharePOint Id([email protected])',
From : "Gmail Id([email protected])",
Subject : "Send by admin",
Body : "And this is the body"}).then( message => alert(message));
});
Throwing error “The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required.”