2

I have a Ubuntu 14.0 server running with NginX on Digital Ocean .

I tried to add following PHP code

@mail($email_to, $email_subject, $email_message, $headers); 

But its not working

so I googled and followed following tutorial

https://holarails.wordpress.com/2013/11/17/configure-sendmail-in-ubuntu-12-04-and-make-it-fast/

So now My hots file look like this

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data
127.0.1.1 iclock iclock
#127.0.0.1 localhost

127.0.0.1 localhost localhost.localdomain iclock

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

and then I run following command

sendmailconfig

But still when I try sending Email its not working .

Any help would be Appreciated .

Thanks

Alexey Ten
  • 13,794
  • 6
  • 44
  • 54
Vikram Anand Bhushan
  • 4,836
  • 15
  • 68
  • 130
  • @KirkBeard can you help me out which file to check for , Email related error ? – Vikram Anand Bhushan Mar 02 '16 at 13:43
  • or ANy way I can test this using Command line – Vikram Anand Bhushan Mar 02 '16 at 13:44
  • 2
    `mail()` also opens a socket, sends the mail and then closes it, if you gotta send a mail to 100 users, it'll do this 100 times and it will be slow, so it might be better to look for an alternate to `mail()` (there's plenty) –  Mar 02 '16 at 13:45
  • @Neat Yes I am aware of the packages , Just one last thing , I tried sending email through command line and its working , SO can you tell me whats wrong could be the mail() function – Vikram Anand Bhushan Mar 02 '16 at 13:56

0 Answers0