Zend - The PHP Company




Email

Add Code


Quick N Dirty Email  

Type: code fragment
Added by: dwilson
Entered: 28/01/2001
Last modified: 07/12/2001
Rating: **** (14 votes)
Views: 12801
This function (actually 2) connects to any SMTP server and sends a basic email. No fluff... no attachments... no mime-type... just the email. This eliminates that pesky problem with the return-path being automatically set to the webserver user when sending through PHP's mail function.


<?php
</code>
?>


Usage Example


// Sample Usage
// If you are returning the error message, be sure to check the result with a triple equal (===)
$mail_settings[to]        = "Good Buddy <buddy@buddydomain.com>";
$mail_settings[from]    = "PHP Guru <your_name@domain.com>";
$mail_settings[subject]    = "Dude... Check this out!";
$mail_settings[prior]    = 1;
$mail_settings[msg]        = "Dude... you gotta checkout my new email function... it rocks!";

$email_good = quick_dirty_email($mail_settings, true);
if ($email_good === true) {
    echo "All's good!";
} else {
    echo "Error: $email_good<br>";
}


Rate This Script





Search



This Category All Categories