Configure SMTP Connection in PHP

`<input type="text" name="host">`
`<input type="number" name=" port">`
`<input type="text" name="isSSL">`
`<input type="email" name=" emailid">`
`<input type="password" name=" password">`
`<input type="button" name="authenticate">`

I want create a function in PHP where I want configure or check SMTP connection throught above form.

If user input all details and click button then, code validate all credentials is correct or not, if correct then echo SMTP Verification Done else SMTP Failed [$reason]

I find this trouble on stackoverflow and this community but I couldn’t find that same I want. I am not only one who asking this question.

Community How I achieve this? in php

What code do you have so far? First off, start with the PHP code to get the information from the form and check that each field has been filled in. Once you’ve done that, you can add more complex validation code.

No, I haven’t code and I couldn’t found on google…
But I have questions ,Let supposed I want to check user SMTP credentials connected to the host or not.

So I made the above form user enter his data like Host,Port,Password,Email,SSL/TLS and hit submit form authentic the data, iF data correct and SMTP correctly connected to HOST echo successful else bad credentials.

I understand what you’re trying to do from your first post. How much experience of PHP do you have?

no, I not made the code yet… I dont knowledge what its initialization… I try to find this on big Question site stackoverflow but i also couldn’t find there…

My guess is because it’s very big. Too big for a simple “here’s the answer”.

Having an idea of what you want to develop is good. And putting together a mock-up form is good. But it is only the barest beginning.

What “SMTP” related functions does PHP have? AFAIK, none. If I’m wrong, please correct me, if I’m right, you’ll need to look at PEAR / PECL or something else more than what comes with PHP “out of the box”.

This will require knowledge of your particular set-up.

Have you ever installed a PEAR or PECL package?

In cPanel it installed, As when download some shopping website through softaculous , in that shopping admin>Email setting we can see SMTP configuration form…

Ah, that’s different from what the topic title suggests.

Does the cPanel API have the functions(s) you need? Have you obtained your developers license?

Topic closed

Continued at How to validate SMTP credentials before sending email in PHP? - #2 by chorn