Darco Posted January 24, 2012 Share Posted January 24, 2012 I can not send mail using my php scripts. If I take my files and move them over to my web host, I can send just fine but when I try to send from my server at the office...nothing. My question is... How do you set up a computer to send mail via php? Do I just config the php.ini? Do I need a mail sending programs such as mercury? Please help, I'm currently try to us XAMPP. Thanks guys, Quote Link to comment https://forums.phpfreaks.com/topic/255700-cant-send-mail-using-php-please-help/ Share on other sites More sharing options...
AyKay47 Posted January 25, 2012 Share Posted January 25, 2012 you will need to adjust some things in the php.ini file. 1. you need to set the SMTP directive to the smtp server name of your ISP. 2. set the smtp_port directive to 25, if it is not already so. 3. you will most likely also need to set a "from" header. Quote Link to comment https://forums.phpfreaks.com/topic/255700-cant-send-mail-using-php-please-help/#findComment-1310847 Share on other sites More sharing options...
Pikachu2000 Posted January 25, 2012 Share Posted January 25, 2012 The vast majority of ISPs don't allow unauthenticated external SMTP connections. PHP's mail() function likely won't work if the SMTP server requires authentication. PEAR::MAIL or PHPmailer are two classes that do support authentication. Otherwise, the answer to your question is yes, you would need to install a mail server or point php to the company's internal mail server, if the admin will allow internal connections to be made without authentication. If not, refer to previous sentence . . . Quote Link to comment https://forums.phpfreaks.com/topic/255700-cant-send-mail-using-php-please-help/#findComment-1310850 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.