Ask HN: Create an app that sends an email with some text

4 pointsposted 5 hours ago
by thr0waway1

Item id: 41622390

15 Comments

henricourdent

6 minutes ago

Windmill.dev can do that easily. You can set a cron schedule to trigger a flow that does exactly what you want. If you are not a programmer, you can pick scripts (steps of the flow) from existing list Windmill Hub library (example to send an email) and use AI for the code of your actual business logic (the database part). Apart from that, you don't have to worry about code and maintenance. It's self-hostable or for less than 1k executions per month, you can use the cloud version for free.

xupybd

2 hours ago

Most email providers have APIs now. This is probably one rest call. Super easy in most languages.

  Pick a language.
  Pick an email as a service. 
  Read the docs. 
  Extend an example for your needs
  Set-up your cron job

  Profit

panosfilianos

3 hours ago

Maybe someone is more knowledgable but I think the biggest issue here is deliverability.

You'll probably have to use a reputable provider's API (eg. GMail, Twilio etc.) because otherwise the recipients' provider are likely to flag you as spam and people never see your email.

asciimov

2 hours ago

This sounds like a CS 102 homework assignment. Break out a book on bash scripting an get to hacking.

porlw

2 hours ago

This can easily be done with a small shell script and standard linux commands.

   #!/usr/bin/bash
   
   MAILTEXT=$(grep "dbkey" db.txt)
   
   cat emails.lst|while read ADDR NAME
   do
      mail -s "Subject" $ADDR <<EOT
   Dear $NAME

   $MAILTEXT

   EOT
   
   done
Schedule with cron.

nh2

12 minutes ago

This is unsafe (glob injection).

Never use bash unless you know exactly what you are doing, and even then, better don't.

Even worse to recommend bash to somebody who already stated that they don't know what they are doing.

Just use Python for such scripts, it won't let you shoot yourself into the foot with surprising behavior.

masteruvpuppetz

2 hours ago

If you're Microsoft 365 subscriber, then u can set up a PowerAutomate job.

Benefit of this route is lots of youtube tutorials explaining this and written documentation.

Hope this helps.

perteraul

an hour ago

While all of the answers are valid, another option that I don't see here is n8n. I used it for something very similar to your requirement and was able to run it for years without intervention.

antonzorin

3 hours ago

After the question I wonder what do you mean by technical PM?

oulipo

2 hours ago

I would suggest either a platform like hosted Windmill.dev or other,

or val.town which has an AI assitant so you can use it even if you don't code

nbbaier

2 hours ago

I came to say val.town. It's trivial to do what you want to do

sfmz

5 hours ago

DB trigger plus a call to Gmail API? o1 can probably handle that.

michelsedgh

4 hours ago

Yes o1 is really good even claude could do something like this, o1 just does it faster. I have made much more complex apps using both clause and now o1 cause o1 is faster, claude took me a lotta time but its absolutely possible. very easy actually. Good luck.

slater

5 hours ago

1) get a cheap-o webhost that offers cron job support

2) learn some PHP + MySQL

3) Use PHP's built-in 'mail()' function to send an e-mail

4) Set up a cron job that runs the PHP file at 4AM

orionblastar

5 hours ago

In 1995 I made an MS Access database that had emails in a table and used MAPI with Eudora Pro to send emails. I called the database SPAM, Software Programmable Automatic Spammer. I refuse to make any more SPAM programs.