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. ?>




                            Zoho Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation


                                        Manage your brands on social media



                                                Zoho TeamInbox Resources

                                                  Zoho DataPrep Resources



                                                    Zoho CRM Plus Resources

                                                      Zoho Books Resources


                                                        Zoho Subscriptions Resources

                                                          Zoho Projects Resources


                                                            Zoho Sprints Resources


                                                              Qntrl Resources


                                                                Zoho Creator Resources


                                                                  Zoho WorkDrive Resources



                                                                    Zoho Campaigns Resources

                                                                      Zoho CRM Resources

                                                                      • CRM Community Learning Series

                                                                        CRM Community Learning Series


                                                                      • Tips

                                                                        Tips

                                                                      • Functions

                                                                        Functions

                                                                      • Meetups

                                                                        Meetups

                                                                      • Kbase

                                                                        Kbase

                                                                      • Resources

                                                                        Resources

                                                                      • Digest

                                                                        Digest

                                                                      • CRM Marketplace

                                                                        CRM Marketplace

                                                                      • MVP Corner

                                                                        MVP Corner

                                                                      





                                                                      




                                                                          Design. Discuss. Deliver.

                                                                          Create visually engaging stories with Zoho Show.

                                                                          Get Started Now