Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2003
    Location
    PHP-LAND
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Testing SMTP server settings

    Hello everybody.
    I am developing a little system, what verifies every setting option, what user inputs.
    So, one thing, what I have to test, is SMTP. Does somebody know a good trick or snippet, how to test SMTP without sending e-mail?

  • #2
    Regular Coder
    Join Date
    Dec 2004
    Location
    Manchester, UK
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What do you need to test?

    You can try Swift mailer then print_r() the "transactions" property.

    This plugin would prevent it from getting as far as sending mail:

    PHP Code:
    class Swift_Silly_Plugin
    {
        public 
    $pluginName 'silly';
        private 
    $swiftInstance;
        
        public function 
    loadBaseObject(&$swiftInstance)
        {
            
    $this->swiftInstance =& $swiftInstance;
        }
        
        public function 
    onBeforeCommand()
        {
            if (
    $this->swiftInstance->responseCode == 354)
            {
                die(
    print_r($this->swiftInstance->transactions1));
            }
        }

    But in essence you just need to use fsockopen() to write to the server.

    You might want to look at fakemail (sourceforge) too. It's saves mail to a file rather than sending it BUT it doesn't support any ESMTP extensions... it's a really basic SMTP only.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •