Version 1 (modified by 5 years ago) ( diff ) | ,
---|
How do I send email from my PHP-based web sites hosted at MayFirst (e.g. Drupal, Wordpress, etc.)?
If your site sends minimal, primarily "internal" to your organization email, for example, password resets for administrators, then it may be acceptable to use PHP's built-in mechanisms for email (the mail() function). Using this default method will send via whatever the web server is configured to do locally (i.e. it runs the sendmail command under Linux). Typically this means the server will send email on it's own behalf. Note that SPF should be configured to add the web server to your list of allowed senders.
If, however, you have a larger audience receiving emails from your site, for example: members in CiviCRM, a forum of some sort, or other larger lists of site members, you will want to ensure proper delivery by using the bulk.mayfirst.org mail relay. This recommendation applies when the web-application itself must email it's members directly. When this is not required, you should consider using mailman which is an included feature of your May First/People Link account.
Using bulk.mayfirst.org
Assuming the web site must manage it's own emails, you can connect to the bulk.mayfirst.org SMTP server from PHP by using the PHPMail library, in the case you are writing your own PHP application. If you are using Drupal, you may use the SMTP or PHPMail Drupal modules, both of which integrate PHPMail. There are also several plugins for Wordpress that may be suitable. Other CMS's are likely to include some sort of support or add-in to enable this feature, so searching for a well-supported existing solution is likely a good first step. Configuration should involve specifying the server as bulk.mayfirst.org
with no login credentials (your server should already be 'trusted' to send email this way without any login required).
When sending email through the bulk mailing system, ensure that spf.mayfirst.org is added to your SPF list. The server itself need not be listed for email delivered this way (unless other applications on the server are sending email directly).