This is a known issue. Check out this msdn link. It states the following in answer:
The SMTP Task in SSIS only supports Windows Authentication and the
port number cannot be changed. For a SMTP server that uses non-Windows
Authentication, we can use SmtpClient Class in Script Task to send the
email
That's why sending email via office365 fails.
In order to work with office365, either you can look for third party plugins integration with SSIS or you can use script task
like below:
using System.Net.Mail;
using System.Net;
.
.
.
public void Main()
{
MailMessage mail = new MailMessage("<from email address>", "<to email address>");
mail.Body = "ssis sample email body";
mail.Subject = "ssis sample email subject";
//mail.Attachments.Add(new Attachment(AttachmentDiscardContratti));
//mail.Attachments.Add(new Attachment(AttachmentDiscardOrdini));
SmtpClient client = new SmtpClient("smtp.office365.com", 587);
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential("<login email>", "<login password>");
client.Send(mail);
Dts.TaskResult = (int)ScriptResults.Success;
}
ps: swap and as I am not sure which one comes first.
another sample of code is available in this SO answer (not tested by me)