Use php function mail() with zohomail smtp servers

Use php function mail() with zohomail smtp servers

Hello,

I was wondering if it is possible to use the php mail() function with my email account on zohomail
I tried, but nothing happened

for example:
  1. <?php

  2. ini_set('SMTP','smtp.zoho.com');
  3. ini_set('smtp_port',465);
  4. ini_set('sendmail_from', 'admin@moderactif.com');

  5. //define the receiver of the email
  6. $to = 'niko@moderactif.com';
  7. //define the subject of the email
  8. $subject = 'Test for title'; 
  9. //define the message to be sent. Each line should be separated with \n
  10. $message = 'Message to send'; 

  11. //define the headers we want passed. Note that they are separated with \r\n
  12. $headers = 'From: admin@moderactif.com\r\nReply-To: admin@moderactif.com';

  13. //send the email
  14. $mail_sent = mail($to, $subject, $message, $headers);
  15. mail($to, $subject, $message, $headers);

  16. //if the message is sent successfully print "Mail sent correctly". Otherwise print "Mail failed" 
  17. echo $mail_sent ? "Mail sent" : "Mail failed";
  18. ?>