Location: PHPKode > projects > EXtensible Production Suite (XPS) > xpsdev/helpers/xpm3/DOCUMENTATION/smtp/connect.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>XPM3_SMTP::connect()</title>
<style>
body, pre {
	font-family: Verdana;
	font-size: 10pt;
}
</style>
</head>
<body bgcolor="#f1f3f5" topmargin="10" leftmargin="14">

<pre>
XPM3_SMTP :: <i>array</i> <b>connect</b> ( <i>string</i> address [, <i>string</i> username [, <i>string</i> password [, <i>integer</i> port [, <i>mixed</i> ssl [, <i>integer</i> timeout [, <i>string</i> hostname ]]]]]] )
<hr>
Open a connection to specify <i>string</i> address.

Default values are:
<i>string</i> username: empty
<i>string</i> password: empty
<i>integer</i> port: 25
<i>mixed</i> ssl: <i>boolean</i> false
<i>integer</i> timeout: 30
<i>string</i> hostname: empty

<i>mixed</i> ssl possible values are: <i>boolean</i> false, true; <i>string</i> tls, ssl, sslv2, sslv3

<i>string</i> hostname is used during the SMTP conversation in the "EHLO" or "HELO".

<i>Notice</i>: <i>string</i> address can have hostname or IPv4 value.
The standard port values are: 25 - default, and 465 - SSL (secure).

Example:
<table border="0" bgcolor="white">
<tr><td>
<pre><code>
$conn = XPM3_SMTP::connect('smtp.mail.tld', 'username', 'password', 465, true);

// print_r($conn);

// compare and print result
if ($conn['connection']) echo 'Connection established, waiting for new instructions.';
else echo 'Can\'t connect.';
</code></pre>
</td></tr>
</table>

<hr color="white">

[ <a style="color: blue; text-decoration: none" href="mailto:hide@address.com?subject=Comment XPM3_SMTP connect">Comments</a> ]

Last update: Monday, January 22, 2007

</pre>

</body>
</html>
Return current item: EXtensible Production Suite (XPS)