Simply what the title says. Want to know how to check if the connection is working and if not, what is the error. Btw the SMTP server is exchange 2007.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
it could be due to your SMTP port is not allowed on firewall so Try this php script to check open ports, it's have maximum popular port checking:
Source From: https://www.interspire.com/support/kb/getattachment.php?data=MTA2OHxwb3J0Y2hlY2sucGhw
If you want to know if you can access the SMTP server from wherever you are running PHP, then you just need to connect to it on the appropriate port (default 25) and see if you get back a "220" code in the result.
Since this is most likely related to your other question: Configure mail server to work with PHP, I'll put the answer here too:
You're using the PEAR Mail package. The
send()
method returns TRUE on success, or aPEAR_Error
object otherwise, which will contain details of the failure. Most likely you'd want $PEAR_Error::message. Full details here: Configure mail server to work with PHP