mail function with smtp auth

AirHost

Member
Jan 26, 2013
10
0
1
cPanel Access Level
Root Administrator
Hello,

Need help. I've googled and search this forum a lot and I didn't find the answer. How can I configure that PHP mail function to work only with SMTP AUTH?
Installed PEAR modules: Mail, Net_SMTP, Net_Socket, Auth_SASL & Auth_SASL2.
PHP.ini SMTP PORT 465/26
Restarted Apache, exim

Still doesn't work. How m I testing to see if it's working or not? I got a contact form (wordpress plugin) and it's still sending mails.

Please help :(
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
You might want to have a look at their support forums:
/http://wordpress.org/support/plugin/contact-form-7


The only flexible thing I see about that plugin is how to use it, not how it works. It's simple, as it says it is. basic.

Instead of installing all kinds of things you probably didn't have to, you might look around for a more complete contact form plugin.
 

AirHost

Member
Jan 26, 2013
10
0
1
cPanel Access Level
Root Administrator
You might want to have a look at their support forums:
/http://wordpress.org/support/plugin/contact-form-7


The only flexible thing I see about that plugin is how to use it, not how it works. It's simple, as it says it is. basic.

Instead of installing all kinds of things you probably didn't have to, you might look around for a more complete contact form plugin.
You missunderstood what i want to do. Let me repeat : I want all mails (web forms)sent via MAIL function to be sent WITH smtp account. It doesn't matter what plugin my customers use. MAIL function must work only with SMTP by default.
 

jakesully

Well-Known Member
Nov 9, 2011
50
0
56
cPanel Access Level
Root Administrator
You missunderstood what i want to do. Let me repeat : I want all mails (web forms)sent via MAIL function to be sent WITH smtp account. It doesn't matter what plugin my customers use. MAIL function must work only with SMTP by default.
what infopro meant is that you should ask the guy who made the plugin how to get it to use SMTP method and not PHP mail function instead of asking cpanel team here since wordpress is a 3rdparty and cpanel team here dont give support to 3rdparty stuff.

Because what mather is mostley how script is coded what function it wants to use so i guess person who made contact form 7 plugin for wordpress must of coded php mail function instead of smtp auth function so thats the reason why infopro told you to contact coder about it and ask him if he could add a SMTP auth feature so you can use that into script since you cannot do SMTP auth only on cpanel/whm just to get script to use SMTP, thats more up to how plugin is coded and nothing todo with cpanel/whm.
 
Last edited:

AirHost

Member
Jan 26, 2013
10
0
1
cPanel Access Level
Root Administrator
what infopro meant is that you should ask the guy who made the plugin how to get it to use SMTP method and not PHP mail function instead of asking cpanel team here since wordpress is a 3rdparty and cpanel team here dont give support to 3rdparty stuff.

Because what mather is mostley how script is coded what function it wants to use so i guess person who made contact form 7 plugin for wordpress must of coded php mail function instead of smtp auth function so thats the reason why infopro told you to contact coder about it and ask him if he could add a SMTP auth feature so you can use that into script since you cannot do SMTP auth only on cpanel/whm just to get script to use SMTP, thats more up to how plugin is coded and nothing todo with cpanel/whm.
I know how to make that plugin to work with SMTP. that's not the case here. let me clear it your you: MAIL php function must work with smtp. I want the plugin(or any contact forms plugins) (as it is) to DO NOT WORK without SMTP.
 

jakesully

Well-Known Member
Nov 9, 2011
50
0
56
cPanel Access Level
Root Administrator
um well it doesent use SMTP by default it executes a .exe file or w.e file it has for linux instead of login in to SMTP mail server and then sends a mail.

easyiest way is todo like this create a e-mail account to w.e you want like [email protected] or so that you want it then that login details on your script and assign your domain as your SMTP server :)

Note: I have just checked and it sems it was correct it uses a file called /usr/sbin/sendmail so every time a php script executes php mail it will then tell php to execute sendmail file with content the script tells it to send as mail.
 
Last edited:

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Sorry, for the confusion. I hope this doesn't add to it.

In WHM » Service Configuration » PHP Configuration Editor, Advanced Editor, find:
disable_functions
This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode.
Add to your existing list here: mail

Save, Restart Apache.

That might be useful to you. GL!
 

AirHost

Member
Jan 26, 2013
10
0
1
cPanel Access Level
Root Administrator
um well it doesent use SMTP by default it executes a .exe file or w.e file it has for linux instead of login in to SMTP mail server and then sends a mail.

easyiest way is todo like this create a e-mail account to w.e you want like [email protected] or so that you want it then that login details on your script and assign your domain as your SMTP server :)

Note: I have just checked and it sems it was correct it uses a file called /usr/sbin/sendmail so every time a php script executes php mail it will then tell php to execute sendmail file with content the script tells it to send as mail.
It can be done. That's why I posted here, so maybe i can get some help. Well, that's why I installed PEAR modules, so that php doens't use the sendmail by his own and send mails without SMTP authentification.
 

AirHost

Member
Jan 26, 2013
10
0
1
cPanel Access Level
Root Administrator
Sorry, for the confusion. I hope this doesn't add to it.

In WHM » Service Configuration » PHP Configuration Editor, Advanced Editor, find:


Add to your existing list here: mail

Save, Restart Apache.

That might be useful to you. GL!
Yap. Now it WORKS! Million thanks!