
#Sendmail php for mac install
Install msmtp sudo apt-get install msmtp-mta ca-certificatesĬreate a new configuration file: sudo vi /etc/msmtprc It's lightweight and much simpler to configure. You could install a full-featured mail transfer agent (MTA) like Postfix to serve this function, but it's overkill if you only need to send mail through PHP. PHP requires an SMTP client to send mail. (If you want to be on the safe side, then create a dummy Gmail account) nothing will happen on the screen or someplace of the whole process would block your authentication. Gmail (and perhaps other services) may not like it that you are attempting to send mail this way as it could be deemed insecure by their standards, and would block your attempt i.e. Related: PEAR::Mail interface might also be of interest to you.

Yet some smtp providers require a specific address as the sender or encryption. You might have to circumvent the 'permission denied' bug by chown postfix:postfix /etc/postfix beforehand. Sudo postmap /etc/postfix/sender_canonical Sudo postmap hash:/etc/postfix/sasl_password
#Sendmail php for mac update
Update postfix: sudo chmod 600 /etc/postfix/sasl_password # for safety of your smtp password Smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwordĬreate a file /etc/postfix/sasl_password with a line like: the actual password, username and smtp-address. Smtp_sasl_security_options = noplaintext noanonymous
#Sendmail php for mac software
This is how you configure postfix using password authentication (sasl):īy clicking the Software Center icons or from terminal using: sudo apt-get install libsasl2-2 libsasl2-modules sasl2-binĮnable sasl-auth by adding these lines to /etc/postfix/main.cf # add to /etc/postfix/main.cf

Also there are things like encryption to consider (which you'll have to google). So postfix will need to know that password. Most smtp-servers require a password authentication to send mail. The rest of the options is self explanatory. As smtp-server (outgoing mail server) you will then have to specify your providers smtp. That means mail will be sent using an extern provider. Most likely you will choose a satellite install. The rest of the install options depend on your choice of this general configuration. You can only send mail from user to user on the system. Mail is stored locally but sent through an external mail provider. Google) will be used for sending and receiving mail.

Otherwise you have to specify sendmail_path = /usr/sbin/ssmtp -t) ( From comments of and You do not have to specify ssmtp here because the installation should have created a symlink for /usr/sbin/sendmail, which correctly points to ssmtp. It should read as: sendmail_path = /usr/sbin/sendmail -t

Now make sure that your php.ini has correct sendmail_path. Of course you can use any other SMTP server). Then edit /etc/ssmtp/nf file, comment out existing mailhub line and add the following lines (this example is for gmail smtp server): your gmail username & password. Install it by running: sudo apt-get install ssmtp It will use any smtp server to send outbound emails. I personally use very simple and lightweight package ssmtp. As already noted, postfix would be an overkill if you just need to send emails from php while developing applications on your home computer.
