Source for file basic.php
Documentation is available at basic.php
$host = 'mail.example.com';
$from = 'user@example.com';
$rcpt = array ('recipient1@example.com', 'recipient2@example.com');
$subj = "Subject: Test Message\n";
$body = "Body Line 1\nBody Line 2";
/* Create a new Net_SMTP2 object. */
die ("Unable to instantiate Net_SMTP2 object\n");
/* Connect to the SMTP server. */
} catch (PEAR_Exception $e) {
die ($e->getMessage () . "\n");
$smtp->auth ('username','password');
/* Send the 'MAIL FROM:' SMTP command. */
} catch (PEAR_Exception $e) {
die (" Unable to set sender to <$from>\n" );
/* Address the message to each of the recipients. */
} catch (PEAR_Exception $e) {
die (" Unable to add recipient <$to>: " . $e->getMessage () . "\n");
/* Set the body of the message. */
$smtp->data ($subj . "\r\n" . $body);
} catch (PEAR_Exception $e) {
die ("Unable to send data\n");
/* Disconnect from the SMTP server. */
Documentation generated on Mon, 11 Mar 2019 15:57:16 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|