Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Aug 11 at 18:33
  • 1
    is the mail server on your Ubuntu box supposed to deliver the email locally or to a remote service such as Gmail? is your php website on the same machine? is it in a container? if you install a mail client such as mailx can you send mail in the way you expect? Commented Aug 11 at 22:26
  • 1. Another question: does your domain have an MX record pointing at the hostname or IP address of the machine you want to use as a mail server - if not, you'll never get any replies. 2. Since you're new to SMTP: avoid sendmail. There's no good reason to use it unless you've already been using it for 30+ years. Use something modern and much easier to configure and work with. Postfix is good. Exim is good too, although since it's basically a modernised and updated fork of smail it's almost as old as sendmail. Commented Aug 12 at 2:24
  • 1
    3. if your php contact email script doesn't have the recipient address hard-coded into the script itself (or a config file for that script), then spammers WILL find it and abuse it and your mail server will be blacklisted almost instantly. i.e. don't take the recipient address from the web form, even in a "hidden" field, that's only hidden to anyone who doesn't bother to look at the HTML source of the contact page (i.e. not hidden at all). Commented Aug 12 at 2:25
  • I have also struggled with postfix. Please look at this question and answer, the references quoted may also help you. superuser.com/q/1877944 Commented Aug 12 at 15:43