the best way to not flood your mail server
there is not much you can do about this, other than checking with your administrator a mail server (if this is a hosting account / is not in your control). but if the requirement is one email to one recipient per event, this should not be too much of a problem. the things that usually clog up mail systems are emails with hundreds (or more) of recipients.
if you have events that are firing all the time, maybe consider consolidating them and sending an email that summarizes them periodically.
sending messages as if it were a specific user, but still clear from your application (to ensure that complaints, etc. are returned to you), without violating good mail etiquette
you can accomplish this using the โReply-Toโ header, in which clients will use this address instead of the From address when creating an email message.
you should also set the "Return-Path" header of any email, as email is often filtered out without it.
ex.
From: me@me.com Return-Path: me@me.com Reply-To: auto@myapp.com
setup and use of sender identifiers, domain keys, SPF, reverse dns, etc. to make sure that your letters are correctly identified
it all depends on how much you own your mail and DNS servers. spf / sender-id etc. - All DNS problems, so you need to have access to DNS.
in your example, this may be a problem. since you are setting up mail for a specific user, an SPF must be installed for this user (for example) installed in their DNS so that your mail server is the actual sender. you can imagine how randomly (if not completely impossible) this would happen with a number of users with different domain names.
as for reverse DNS, etc., it really depends. most internet service provider clients etc ... just check to set reverse DNS. (i.e. 1.2.3.4 allows host.here.domain.com, even if host.here.domain.com does not allow return to 1.2.3.4). this is due to the amount of shared hosting (where mail servers often report themselves as the client's domain name, rather than a real mail server).
There are several strict networks that require reverse DNS mapping, but this requires that you control the mail server if it does not match in the first place.
if you can be more specific, I can provide a little more advice, but as a rule, for people who need to send application mail and they donโt have a lot of control over their environment, I would suggest the following:
- make sure the return path is set
- It's nice to add your application and information about abuses, as well as in the headers, that is: "X-Mailer" and "X-Abuse-To" (these are custom headers, for informational purposes only).
- make sure that the reverse DNS server is set for the outgoing mail server DNS address.