Re: Problems with Mail.php using SMTP
| From: | Chuck Hagenbuch | Date: | Sun, 07 Sep 2003 02:26:26 +0000 |
| Subject: | Re: Problems with Mail.php using SMTP | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7620@lists.php.net to get a copy of this message | ||
Quoting "Boget, Chris" <chris@wild.net>:
> Here is my little test script:
>
> <script language="php">
>
> require_once 'Mail.php';
>
> $email = Mail::Factory( 'smtp' );
>
> $recipientArray = array( 'To' => 'joe@bob.com' );
This should just be an array of addresses - not a hash.
> $headersArray = array( 'From' => 'here@there.com',
> 'CC' => 'here@there.com',
> 'Subject' => 'Test email from PEAR',
> 'Reply-to' => 'chris@wild.net' );
Put the To: header here if you want it to show up as an actual header.
> $emailBody = date( 'H:i:s' ) . "\n";
> $emailBody .= 'This is a test run of my mail script';
>
> $result = $email->send( $recipientArray, $headersArray, $emailBody );
>
> echo 'Result:<pre>'; print_r( $result ); echo '</pre>';
>
> </script>
-chuck
--
Charles Hagenbuch, <chuck@horde.org>
They're just looking at a wall of meat.