Location: PHPKode > projects > EXtensible Production Suite (XPS) > xpsdev/helpers/xpm3/DOCUMENTATION/smtp/sendtohost.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>XPM3_SMTP::sendtohost()</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>sendtohost</b> ( <i>mixed</i> address, <i>array</i> to_mails, <i>string</i> from, <i>string</i> message [, <i>string</i> hostname [, <i>string</i> returnpath [, <i>integer</i> port [, <i>integer</i> timeout ]]]] )
<hr>
Send a mail message to specify <i>mixed</i> address (can be resource connection, hostname or IPv4 value).

Default values are:
<i>string</i> hostname: empty
<i>string</i> returnpath: empty
<i>integer</i> port: 25
<i>integer</i> timeout: 30

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

Example:
<table border="0" bgcolor="white">
<tr><td>
<pre><code>
$mess = 'From: hide@address.com'."\r\n".
        'To: hide@address.com'."\r\n".
        'Subject: test'."\r\n".
        'Date: '.date('r')."\r\n".
        'Content-Type: text/plain'."\r\n\r\n".
        'Text message.';

// send mail
$send = XPM3_SMTP::sendtohost('smtp.mail.tld', array('hide@address.com'), 'hide@address.com', $mess);

/* OR via SSL and autentication:
$conn = XPM3_SMTP::connect('smtp.mail.tld', 'username', 'password', 465, true);
$send = XPM3_SMTP::sendtohost($conn['connection'], array('hide@address.com'), 'hide@address.com', $mess);
*/

// print result
print_r($send);
</code></pre>
</td></tr>
</table>

<hr color="white">

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

Last update: Monday, January 22, 2007

</pre>

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