Home > front end >  host disable php mail function
host disable php mail function

Time:06-26

My host has disabled mail function , as he has said for security reasons . But my wordpress website needs it; I have access to cpanel . DO anyone has an idea how to deal with that? Thanks in advance

CodePudding user response:

As you have rightly indicated in your question "it was disabled for security reasons." Web Hosters have the right to disable accounts when the account's activity goes against its usage policies.

When the mail is used for spam then it will be disabled. You may need to disable some plugins that makes use of the email service. An example is to disable receiving of email notification when a user comments on a post.

Also, you can email your web hosters and enquire on specific things to do in order curb the "security issue".

CodePudding user response:

There is an alternative to the mail() function called PHPMailer

Here is the link to their github : https://github.com/PHPMailer/PHPMailer ( Its a really cool package, allowing you to send emails, and it's really easy to use and debug )

The Installation guide explains how to install their package ( With Composer, you can download composer here )

The simple exemple shows you everything you need to know about PHPMailer. Note that you may need an SMTP in order to send Emails. You can use your own Email box, or you can buy one ( https://www.mailjet.com/ , https://fr.sendinblue.com/ )

( To access to theses part, just scroll down on their github page )

Have a nice day !

  • Related