Currently I am making feedback contact form without a plugin. Trying not to use plugins if possible. In action .php file there must be written server settings such as SMTP server, SMTP username etc. and eventually SMTP password. As it is not a Gmail, but hosting mailbox, SMTP password and mail password are the same. Says, that sending mail using SMTP is more secure. But if I will write all this data into my .php file insite WordPress platform will it be secure? What is possibility to be this data hacked?

  • 2
    No, it's not secure to store any sort of credentials in PHP - or anywhere that others can access. Typically you would want to create an environment variable, or perhaps an encrypted option, to protect the data.
    – WebElaine
    Commented Nov 16, 2021 at 21:17
  • If you have to set it up in your WP application, then use the wp-config.php to set up your SMTP info in constants that you can use in your application. see: wordpress.stackexchange.com/questions/75956/…
    – butlerblog
    Commented Nov 24, 2021 at 16:52
  • In other forums some user adviced me to use separate email address for such purposes.
    – Flagmans
    Commented Nov 24, 2021 at 17:49


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.