How do I send an email using my Outlook account?

This topic was automatically generated from Slack. You can find the original thread here.

Mohammed Zeeshan : Is there an option for Pipedream to offer native mail integration apart from email marketing app integrations? I’m looking for a way to send email from my outlook when an entry is updated in Airtable.

Dylan Sather (Pipedream) : Hi , take a look at the nodemailer package - it allows you to send email using your own account on email providers like Outlook and Gmail.

Add a new step, select the option for Search all actions, and search for “nodemailer” - you’ll see the Send email with Nodemailer action, which wraps the Nodemailer sendEmail method. See this example workflow.

You’ll just need to find the details of your mail server (its SMTP host, port - normally 587 - etc.)

Let me know if that helps!

Mohammed Zeeshan : Awesome! I will check this out :+1:

Mohammed Zeeshan : One noob question btw :grimacing:
Does setting up timer for “x minutes” mean that it sends a trigger each “x minute” ?
Asking because i got a mail yesterday mentioning my daily invocation quota is 80% complete, then later another mail with 100% of daily invocations quota reached.

Also i got an error message while i decided to halt the workflow (pic below).

I guess that sidebar on the left shows the triggers, is that correct?

Dylan Sather (Pipedream) : Yes, setting that timer on the trigger will run the event source at that frequency. Technically the event source runs as its own resource, once every 5 min (in your example). The workflow only runs when the event source “emits” an event: when an Airtable record is added or modified.

The other error should resolve itself on its own - can you try deploying one more time?

Mohammed Zeeshan : Gotcha! I did setup the timer for 15 sec interval later on after getting to wait for 5 minutes :sweat_smile:

Yes, i can redeploy if error should resolve then

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 :slight_smile:

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 :sweat_smile:

:seedling: 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.

1 Like