By streetcoder
Hi,
I am new at linux configuration. My problem is: I do not what tasks should be done to enable sending email from the server. Normally we use contact form where we use php mail() function. I want when I use this function, I would be able to send email. So, please could you guide me anyone as how to configure or which package should be installed.
Moreover, I tried something reading this link https://www.digitalocean.com/community/questions/php-mail-script-does-not-work and use the following command:
sudo apt-get install sendmail
And then applied this command:
sudo netstat -plutn | grep 25
And find the result:
$ sudo netstat -plutn | grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1293/sendmail: MTA:
However, please help what I should do in this circumstance.
Thanks in advance, Shimul
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Using the command you have given, I found:
Connection to smtp.gmail.com 25 port [tcp/smtp] succeeded!
When I use the mail(); nothing happens, no email received to my inbox.
Yes I am getting email using the command: sendmail -v your@email.org < mail.txt
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.