TurnKey Linux Virtual Appliance Library

Configuring PHP to use a different mail server than postfix?

rafael's picture

Can I change PHP to use something other than Postfix for email delivery?

Correct me if I am wrong, I thought that out of the box Drupal can use PHP mailing functions without having to piggyback from an MTA.

If that is possible, where can I change that?

Thank you,

Liraz Siri's picture

Configure PHP to point to a different mail server

E-mail may be more complicated than you think. PHP needs a mail server to send e-mails. The only way they could avoid that is if they implemented a mail server inside PHP, and that would just be reinventing the wheel.

Luckily, you can configure PHP to use a different mail server than the local postfix running by default. You'll need to edit the mail configuration in /etc/php5/apache2/php.ini. You might also be able to do that via Webmin as well.

Another alternative would be to configure Postfix to relay e-mails to another e-mail server (e.g., your ISP's). Google 'postfix relayhost'.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)