Worked like a charm!
Thanks @dylburger for the inputs. Let me write some info in detail here so if someone referring this thread don’t fall into errors i have fallen while setting this up.
You need to first enable POP from your outlook mail settings. Here is a direct link if you are using outlook in your browser
These are the settings you would need for Outlook. These can be found in the settings page above where you enabled POP.
host: smtp.office365.com
port: 587
And also you have to fill your Email and Password in the fields of nodemailer.
Doing anything incorrectly here would throw an Error
Invalid login: 535 5.7.3 Authentication unsuccessful
Even though i went through the above steps correctly after messing up initially, i got another error →
Mail command failed: 451 5.7.3 STARTTLS is required to send mail
So going through the nodemailer documentation mentioning SMTP configuration i made changes to the following fields based on the error message i received in the last workflow
I changed the line 9 and 10 to following respectively
secure: false,
requireTLS: true,
instead of
secure: params.tls, // use TLS
ignoreTLS: !params.tls,
and it worked for me
The first time you enable this trigger and send one, you will find the workflow returned with an error. During this time you might have received an email from Outlook mentioning unusual activity and asking you to review it. Make sure you review and enable it.
If you get stuck here, click me
-
Check the outlook account, see if the mail service provider sent you an email to enable remote login.
-
Login attempt are rejected when you’re trying to login from a new server (seems to be IP-based checking). Once you manually approve the login attempt, that server will be ‘whitelisted’.
-
Also check for the subject (email title). It should be plain text and should not consist html code apart from the dynamic variable(s) from the previous step.
@dylburger Let me know if there is anything wrong i did here or if there is any better way
One final tip
I found this tool which is very helpful in writing a nicely formatted email body. You can design and copy the html and paste in your Pipedream workflow.