Playing around with tech stuff you may find yourself in the need to send application-generated emails for alerts, notifications or any other info. For example, if you want to allow users to change their passwords, most likely you will send a confirmation email in the process. You can use Oracle Email Delivery to do exactly that! You don't need to stress with things like deliverability performance, email authentication standards and so on, Oracle has got you covered!
The first step would be to make sure you correctly configured DNS for your domain. You can manage your zones however you want, but I highly recommend to use Oracle DNS Zone Management to do it. Some time ago Oracle acquired DynDNS and the services we are discussing about are built leveraging Dyn’s best-in-class DNS and email delivery solutions.
If you want to configure your primary zone in OCI, go ahead and point the nameservers to the location of your zone. You'll do that by accessing your registrar management interface and change the existing nameservers with those ones provided by Oracle in the service console, similar to
ns1.p68.dns.oraclecloud.com. Create the zone and you are ready to add resource records to it.
Keep in mind that it might take some time to propagate the changes. If you want to find out why go ahead and research a bit about how DNS servers work. Don't forget to publish your changes!
You can go directly to Email Delivery service if you are working in one of the supported regions (Phoenix and Ashburn at moment), if not, you might need to change the Region in the console. You will notice the SMTP server name and the ports used. You can use the blue button to generate SMTP credentials for your user. The SMTP credentials can be configured for any of the existing users in IAM if for some reason you want to use a different one.
Go ahead and save the credentials as this is the only chance you will get to retrieve them. Once you close the windows, you will need to generate new ones. As always, is super useful to check the documentation: you will find some IAM prerequisites (permissions required for Email Delivery Service), service limitations and very important, how to configure SPF.
Sender Policy Framework (SPF) is used by email receivers to detect email spoofing. Using SPF, an email receiver can check if the Internet Protocol (IP) is explicitly authorized to send for that domain. Receiving mail servers check the SPF records of sending domains to verify that the email's source IP address is authorized to send from that domain. Without SPF, a spam or phishing email can be “spoofed” to appear that the email comes from a legitimate domain. Domains that implement SPF are much more likely to block emails attempting to spoof your domain.
After you add the TXT entry to your zone
v=spf1 include:spf.oracleemaildelivery.com -all you're ready to send your first email. There are many tools out there to play around with SMTP, but I highly recommend swaks. It really is the Swiss Army Knife for SMTP.
swaks -tls -s "This is an email sent by Oracle" \ --server smtp.us-phoenix-1.oraclecloud.com \ --from 'YOUR APPROVED SENDER' \ --to 'DESTINATION EMAIL' \ --auth-user 'YOUR SAVED USERNAME' \ --auth-password 'YOUR SAVED PASSWORD'
The last step? Check your inbox.