    MAIL -> mixed connect ( string address [, integer port [, string username [, string password [, string ssl [, integer timeout [, string name [, resource context [, string auth_type ]]]]]]]] )

    Return RESOURCE connection if has been successfully connected, boolean FALSE if not.

    Default values are:
    integer port: 25
    integer timeout: 30
    string name: localhost

    string ssl possible values are: tls, ssl, sslv2 or sslv3

    Notice: string address can have hostname or IPv4 value.
    The standard port values are: 25 - default, and 465 - SSL (secure).
    string name is used in EHLO/HELO SMTP conversation.

    Example (verification):

    $m = new MAIL;

    // connect to 'smtp.hostname.tld' port '25' with authentication
    $c = $m->Connect('smtp.hostname.tld', 25, 'username', 'password') or die(print_r($m->Result));

    // send mail relay via '$c' resource connection
    $m->Send($c);

    Example (deprecated):

    $m = new MAIL;

    // define connection parameters value
    $m->Host = 'smtp.hostname.tld'; // address
    $m->Port = 465; // port
    $m->User = 'username'; // username
    $m->Pass = 'password'; // password
    $m->Vssl = 'tls'; // SSL
    $m->Tout = 10; // timeout in seconds
    $m->Name = 'localhost'; // local hostname (used in EHLO/HELO SMTP conversation)
    $m->Auth = 'cram-md5'; // authentication type

    // connect using this parameters
    $c = $m->Connect() or die(print_r($m->Result));

    See Also: MAIL->Disconnect(), MAIL->Context(), MAIL->Send()

    [ Comments ]

    Last update: Monday, June 11, 2007