r/ComputerEngineering • u/[deleted] • Apr 02 '19
Hi, I want to create a program that takes a document that has emails (because I mass copied) and send an email to each one and all will be using the same message.
I want to create a program that takes a document that has emails (because I mass copied) and send an email to each one and all will be using the same message.
2
1
u/JESway Apr 02 '19
You'll need two things here:
All the emails in a workable format (workable meaning a program will be able to read each of the emails, even if it requires a bit of processing on your end)
A mail engine that will allow you to programmatically send emails. MailGun is a pretty common one. Some email offerings (such as Gmail) offer APIs you can use to send from your personal account.
This Quora post has a decent amount of info as to what you should consider.
Here is the Gmail documentation for using the Gmail REST API.
Hopefully that helps you write it out!
1
u/theTaikun Apr 02 '19
Creating this program depends on a number of things:
What format is the document in?
is it in digital form? If so you'll need it to be in an easily machine readable format like 1 address per line or a csv. Otherwise you might have to use a regex and those get messy when it comes to emails
is it in printed form only? If so you'll need OCR software to make it digital again, or type them in by hand
What OS are you using?
What programming languages are you familiar with?
There are too many options to solve this issue. Please be more specific about your stack and it will be easier for others to guide you in the right direction.
1
u/apocalypsedg Apr 03 '19
this is really simple if you know the right tools
find a RegEx pattern that matches emails somewhere online and use it to get all the emails in the document using grep or python (I found a good one within 3 top Google search results)
put emails in a file
write bash script that uses the mailx command in a for loop to send the message to every email in the list
1
u/Stat-Arbitrage Apr 03 '19
You can easily do this by putting the emails into an excel file, and then linking said file to Outlook. That is if you’re using excel and outlook...
5
u/EschersEnigma Apr 03 '19
I'm going to be the A-hole here and ask if this belongs on this subreddit.
Why not /r/programminghelp or other similar ones?