Sending Mail from Your App

Last Updated October 2014

Pagoda Box protects your IPs from being flagged as spam by using the SMTP mail protocol to send mail using your third party mail provider's SMTP credentials. After reading this, you should understand:

  • How Pagoda Box sends email from your app
  • How to send mail from your App

Overview

Sending mail from your app can be challenging. You deal with ever evolving spam regulations, security requirements, and complex authoritative mail server configuration. Furthermore, when you layer in the inherent risk that an unscrupulous neighbor might be sending spam from an IP you both share, you run the risk of your legitimate mail being marked as spam. You don’t want to deal with that and neither do we. We’ve designed a mail sending system that circumvents traditional application-based mail problems and makes sending mail from your app simple.

The Technical Mechanics

We’ve built each web and worker service to have a custom Pagoda mail transport agent. Instead of trying to use the local instance to send email, we route all messages sent from your app to a centralized mail delivery system. From there we connect to an authoritative SMTP service that you provide. We then use your SMTP credentials to send the email message.

Pagoda Box is Not an Email Server

Pagoda Box does not offer a built in SMTP service. We allow you to tie into other SMTP providers like Gmail, Mandrill, SendGrid, Amazon SES, etc. Which you use is totally up to you.

Configuring Mail

To configure mail, go to Dev Config > Mail in your App Dashboard.

SMTP Host

The SMTP host allows you to select preconfigured settings specific to each host. If you're using an SMTP host that is not on the list, just select "Custom."

Username/Email Address & Password

The username/email address and password should be those you use to log into your SMTP provider's service.

Outgoing Mail Server, Port, TLS, & Authentication

These settings are specific to each STMP provider. View your provider's documentation to find out which settings you should use.

Sending Mail from Your App

To send mail from a PHP service, use the mail() function. Anything sent using the mail() function will be routed through the centralized Pagoda Box mail delivery system and sent using the SMTP settings you've specified in your dashboard.

Troubleshooting

There are a lot of possible reasons that mail may not be sent (or received) successfully from your app. The following are some tips and common hangups that may help you solve the problem.

Check Your Logs

Many issues that keep mail from being sent successfully will show up in your app's logs. This would be a good place to start troubleshooting.

Connection & Authentication Issues

A common issue people face when configuring the mail service is that either the username and password they provide are incorrect or the connection details are incorrect. Double check your username and password and make sure your outgoing mail server, port, TLS, and authentication settings match those specified by your SMTP provider.

MX Record Configuration

In order for you to be able to send mail from a domain (@domain.com), the domain needs an MX Record. The MX Record tells your nameserver how to route mail. Many SMTP providers require special settings in the MX record settings.

Using an Email Address as Authentication

Some SMTP providers use a specific email address to authenticate access. Depending on your SMTP provider, this may be the only email address your app will be able to send from. For example, if you're using Gmail as an SMTP provider, the only email address your app will be able to successfully send from is the email address you use to authenticate.

Gmail Settings

If you're using Gmail as your SMTP service, there's a few things you need to enable on your Gmail account. Google has a good support thread for Problems Sending Email.

If you have any questions, suggestions, or corrections, let us know.