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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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