I am working on a project for an environmental NGO. They want to let users use a form on their website, provide their name, their email address and select certain emails from a list to send complaints or other contents to city council members or clean-air committee members, and so on.

The form would have these input fields: - Name - Email - Subject line (with default text related to current campaign) - Message (with default text related to current campaign) - Target emails list (the user would check every function/role/person, they'd like the message to be sent to)

The submitted form needs to be sent to the selected addresses with the edited content while setting the header From to the user's Name+Email.

The question is: what needs to be done in order to have this system deliver emails without getting flagged as spam?


One thing you must do in order to avoid the mail being flagged as spam, or rejected entirely, is do not use the user's provided email address in the From field.

Your web form is not authorized to send email from arbitrary domains on the Internet, and destinations which check SPF and DMARC records for domains which use them will either mark these messages as spam or refuse to deliver the messages. Worse, if the message is bounced, the bounce message will end up being delivered to the user who put his email in your web form, and so he will know your form is misbehaving.

Instead, From should contain a no-reply address or a postmaster address which can deal with bounced email. The address provided by the web user should be elsewhere, such as Reply-To (if you want recipients to be able to reply to it), in the body of the email, or both.

  • Thanks @michael ! This is pretty unfortunate. This is one of their main requests. They were afraid that emails won't get delivered if they're all being sent from the same Sender. Each form submission may result in 1-20 different targets. Sometimes they would all reside on the same server, which could block the activists messages. Is there any external service that could use in order to send these letters with a reasonable success? – nudora Feb 23 '16 at 10:12
  • There are three or four such services, if you choose to use them. But it's pretty normal to deliver mail in the way I've described; I don't see why they should be concerned about it being marked as spam. If you do what they've asked for, it's guaranteed to be marked as spam! – Michael Hampton Feb 23 '16 at 10:13
  • Thanks. Could you name these external services? – nudora Feb 23 '16 at 10:19
  • Well, I mean that following this discussion, I will suggest the method you described above, but would also like to include other alternatives and have them decide. – nudora Feb 23 '16 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.