Sending email in a proper way
This page describes how to send emails from your application or system in a proper way.
Things to consider before you go
Sending email is not rocket science (well, today it almost is), but before deciding how to send email from your application, you must always consider:
- What email address are you sending from
- What email address(es) are you sending to
- Where (what system/IP-address) are you sending from
There are spam control/restrictions in place everywhere/anywhere that will block your emails if this is not done properly. Because the internet protocols involved when sending email does not have authenticity verification in place to verify legitimate emails, emails can easily be forged and faked. Email systems therefore add a lot of headers to mitigate this.
To send email, we therefore need to use a system that has been (properly) announced to be allowed to send email from the address you send from. The system you use must also allow you to send from it, to the addresses you want to send to.
Sender considerations
You must be aware of where emails your system sends, are coming from, and what should happen to replies/bounces.
If you're not expecting any replies, and don't care about bounces, you should set the sender address to a noreply-address, like noreply@sikt.no
.
Remember, if you don't handle bounces, you will never know whether you send email to invalid addresses or not.
If you want to receive replies, but never receive bounces, you should set the Reply-To:
header in the emails to the address you want to receive replies, and noreply@sikt.no
in any sender header (e.g. From:
and Return-Path:
).
The mail system you use, must be allowed to send email from the domain in the sender headers.
If not, you risk email being blocked (bounced), considered as junk (delivered to a junk folder or quarantined), or even blackholed (silently deleted).
Email-sending methods
How to do it depends mainly on what you are sending from. Is it email from scripts running on a server? Or is it an application that you wrote?
- It's a server/VM
- It's an application running on PaaS
- It's a serverless application on AWS, or an application running on other managed AWS services
- It's an application neither running on PaaS nor AWS
If none of the above applies to your case, we don't support it at the moment. Contact hjelp@sikt.no for help.