Use ssmtp from php
![use ssmtp from php use ssmtp from php](https://www.hostinger.es/tutoriales/wp-content/uploads/sites/7/2018/04/wp-mail-smtp.png)
USE SSMTP FROM PHP FULL
Commonly mailhosts are named # (not my mail provider though - it's just ) # This usually for TLS #mailhub=:465 # This usually for StartTLS mailhub = :587 # Where will the mail seem to come from? #rewriteDomain= # The full hostname # (can be the server name or an IP address) #hostname= # probably not required # Are users allowed to set their own From: address? # YES - Allow the user to specify their own From: address # NO - Use the system generated From: address #FromLineOverride=NO UseTLS = YES UseSTARTTLS = YES AuthMethod = LOGIN AuthUser = AuthPass = verysecret The actual machine name is required no # MX records are consulted. A quick test:Ĭfg # Config file for sSMTP sendmail # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. If you find this configuration option to be commented out (or not present at all) you can check with phpinfo() most likely you will see sendmail_path /usr/sbin/sendmail -t -i.
USE SSMTP FROM PHP CODE
PHP by default relies on sendmail to send out e-mail (you can check with grep sendmail_path -r /etc/php*), and most contact form plugins or code snippets rely on that.
USE SSMTP FROM PHP INSTALL
With a hopefully clean system, I installed ssmtp: apt-get install ssmtp. If you don't want to use aptitude, this has similar functionality:ĭpkg -l | grep ^rc to see what residual config files are left over andįor i in $(dpkg -l | grep ^rc | cut -d” ” -f3) do dpkg –purge $i done This command: aptitude -s purge ~c will simulate the removal, and this: aptitude purge ~c will finally do it. This command: aptitude search ~c will show what is leftover (I should probably have started with that). It seems that even after that some residual configuration files are interfering. There was a lot of it, even after purging the packages. Leftover configuration/modification in /etc and removed/undid it manually. Performed apt-get -purge autoremove afterwards. I purged all packages that contain 'dovecot' and 'exim4' in their names, and
![use ssmtp from php use ssmtp from php](https://blog.endeos.com/wp-content/uploads/2017/03/phpmailer-tutorial.png)
Previously I had been messing around with dovecot and exim4, which only resulted in breakage, until I realised that these are overkill for my needs.
![use ssmtp from php use ssmtp from php](https://i.ytimg.com/vi/imToK34Jq9c/maxresdefault.jpg)
This server runs debian stable (written when jessie was stable, then stretch, now buster). What I really want is sSMTP, an "extremely simple MTA to get mail off the system to a mail hub". SMART daemon, fail2ban), or if someone tries to contact me on my website, sent to my third party email address. My server is not a mail server, and I never learned to make use of UNIX' internal mailing system.īut sometimes I want to get email from my server, usually diagnostic messages from services (e.g. It seems I have to fix my sSMTP setup every now and then.īe aware that some settings depend not only on your system but also on your email provider. This article is originally from 2016, but I edited it a few times.