Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1054869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:28:27+00:00 2026-05-16T17:28:27+00:00

On some servers, the PHP mail() function requires SMTP authentication (i.e., we have to

  • 0

On some servers, the PHP mail() function requires SMTP authentication (i.e., we have to provide an email address and password). How do I determine through a PHP script if the server requires authentication or not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:28:28+00:00Added an answer on May 16, 2026 at 5:28 pm

    The PHP mail() function only returns true or false, signifying whether the e-mail was successfully handed off to the mailer or not. It isn’t possible to get any extra information, because PHP doesn’t even handle the mailing. It hands it off to sendmail or whatever is configured in PHP.ini.

    To determine the reason for failure, you must use another method. I’d like to second shamittomar’s suggestion of Pear’s Mail package. It is excellent.

    If you use Mail::send() in Pear, it will either return true or a PEAR_Error() object which you can call the getCode() method on and figure out if you have an SMTP authentication error.

    See this for more details: http://pear.php.net/manual/en/package.mail.mail.send.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: php mail() function on localhost I'm trying to do some localhost testing
For some reason, when php mail() is sent to a text number (via email)
For some reason the php mail() function is not working properly on a site
My server have default php version of 4, so when I run some script
I have some php files in a server which generate xml code in them.
I have numerous Corba servers and some other java apps (not web). I wish
I have 100 web servers and noticed that some of them have request filtering
I have been making some research in the domain of servers for a website
I have a few test databases in some Unix SUSE 8 servers and initially
Hi guys for some weird reason I'm unable to send email using zend mail

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.