Dreamhost Email

I’m working with Grav hosted on Dreamhost, and I’m having trouble getting an email contact form working.

I used the example contact form from the documentation, minus the captcha parts, and I setup an account with mailtrap.io. The form completes correctly, and the email is saved on disk. However, the email doesn’t show up in the trap.io account.

Does anyone have any pointers for getting email on Dreamhost working?

I’d like to switch to using the Dreamhost email servers eventually, so any tips on that would be great too.

Email config (Slightly obfuscated. I have a real domain.):
Mail Engine: PHP Mail
Content type: Plain text
Email from *: contact@dev.domain.tld
Email from name: Customer Contact Form
Email to *: ryan@dev.domain.tld
Email to name: Ryan
SMTP server: mailtrap.io
SMTP port: 2525
SMTP encryption: None
SMTP login name: <trap.io username>
SMTP password: <trap.io password ;)>
Path to sendmail: /usr/sbin/sendmail

Mail Engine: sendmail breaks with:
Swift_TransportException
Unsupported sendmail command flags [/usr/sbin/sendmail]. Must be one of “-bs” or “-t” but can include additional flags.

Mail Engine: SMTP breaks with:
Swift_TransportException
Connection could not be established with host mailtrap.io [php_network_getaddresses: getaddrinfo failed: Name or service not known #0]

I got it working. It still needs work, but it works.

Mail Engine: Sendmail
Path to sendmail: /usr/sbin/sendmail -t

You setup Mailtrap SMTP details, BUT you still had “Mail engine” to “PHP Mail” instead of SMTP.
So the email was not sent using mailtrap’s SMTP server.

“PHP Mail” is known to often not work, due to various reasons, and I recommend using a SMTP server instead. Like GMail’s one, for example, or your own.

Now you’re still not using the SMTP server you setup, but using Sendmail.