Skip to Content
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Sign in
  • Nederlands English (US) Español (AR)
  • Contact Us
  • Home
  • Blog
  • Jobs
  • Contact us
Cafayate.Net
  • 0
  • 0
    • Home
    • Blog
    • Jobs
    • Contact us
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Sign in
  • Contact Us

CONFIGURE POSTFIX/SENDMAIL FOR PHP MAIL() IN UBUNTU

  • All Blogs
  • Tech Blog
  • CONFIGURE POSTFIX/SENDMAIL FOR PHP MAIL() IN UBUNTU
  • March 5, 2021 by
    Administrator

    Actually configure Postfix or Sendmail for PHP mail() is the same. Both of them run the /usr/sbin/sendmail binary. It is quite confusing if we just look at the name of the binary but this is what Postfix did.

    For more information, take a look at the Postfix Manual – sendmail.

    For the PHP setting, open the /etc/php5/apache2/php.ini and configure the sendmail_path.
    php.ini

    1
    2
    3
    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ; http://php.net/sendmail-path
    sendmail_path = "/usr/sbin/sendmail -t -i"

     

    Save the file and restart the Apache server.

    Try testing the PHP mail() function by the following command.

    1
    echo testing | mail -s Bla [email protected]

     

    If you need to send with attachment. you can refer to this post.
    PHP – Send Attachment with PHP mail()

     

    in Tech Blog
    Ansible and WordPress: roles and playbooks

    Designed for companies

    We are a team of passionate people whose goal is to improve everyone's life through disruptive products. We build great products to solve your business problems. Our products are designed for small to medium size companies willing to optimize their performance.

    Get in touch

    Plantexel
    Pedernera
    Salta Capital 
    Argenina

    • +31 653-919-302
    • [email protected]
    Follow us
    Copyright © Plantexel
    Nederlands | English (US) | Español (AR)