Jump to content

Cant send mail using php, please help.


Recommended Posts

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,

Link to comment
https://forums.phpfreaks.com/topic/255700-cant-send-mail-using-php-please-help/
Share on other sites

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.

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 . . .

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.