0

I am running automated Tests on Azure Piplines, initially I was planing to read and delete Emails using Gmail API but for that I would need an service account (Because I cant authenticate it using oaut because its running on the Azure Pipline)

Now I am wondering whats the best solution to my problem, are there any other free mail services with an API?

Or am I able to read my Mails with an Imap library (without requiering oaut)

0brine
  • 450
  • 5
  • 18
  • Don't so this in unit testing, it's unreliable. Better to mock out the SMTP sending, or have it save to local disk instead of sending. – DavidG Jul 22 '21 at 12:37
  • Setting up your own IMAP server is dead easy. – arnt Jul 22 '21 at 13:36

1 Answers1

0

Easy solution:

Allow Insecure Apps: https://support.google.com/accounts/answer/6010255

Send Emails (SMTP): https://stackoverflow.com/a/707892/10637110

Read Emails (IMAP): https://stackoverflow.com/a/19570553/10637110

0brine
  • 450
  • 5
  • 18
  • Or better, generate an app specific password. Or host your own SMTP and IMAP server for test purposes. – Max Jul 22 '21 at 16:39
  • could you explain it in more detail, how do I do something like this? – 0brine Jul 23 '21 at 07:15