Use this class if you need to send attachments and/or html messages inside your application. I wrote this class to use it togther with classes like Access_user Class or DB_cart Class (shopping cart). If you need some upload functionality than the Easy PHP Upload should be good for you.
For a first test unpack all files into a directory, and modify this row inside the example file (the example attachment files are an image and an image inside a zip file):
require($_SERVER['DOCUMENT_ROOT']."/classes/attach_mailer/attach_mailer_class.php");
define("LIBR", "\n");
This is a very important variable, in some cases you have to switch between "\r\n" and "\n".
define("PRIORITY", 3);
The mail priority, possible values are: 3 = normal, 2 = high, 4 = low (or others be carefull)
define("TRANS_ENC", "7bit");
The encoding style for the text mimeparts, use "7bit" for the most western languages.
define("ENCODING", "iso-8859-1");
The encoding style for your text presentation, use it the same way then in html documents.
var $text_body;
the text part of the mail message
var $html_body;
the html part of the mail message
attach_mailer($name = "", $from, $to, $cc = "", $bcc = "", $subject = "")
The counstructor method, the attributes "$from" and "$to" (the subject is not required to send an e-mail but you should define a clear subject for all e-mails) are required. While creating an object only the input (e-mail addresses) is validated and if all data is OK a boolean is set. Only if the boolean ($valid_mail_adresses) is "true" a mail will be send.
add_attach_file($file, $encoding = "base64", $dispo = "attachment", $type = "application/octet-stream")
Use this method for every (non inline) attachment you want to send, inside a loop its very easy to handle a dynamic number of files.
add_html_image($img_name)
Add with this method the images used inside the html code if you want to embed the images in the mail (there is no need to link to external images). The will create the internal link inside the email to show the images "inline" of the html.
process_mail()
This method wil send the mail if the boolean ($valid_mail_adresses) is "true". You have to know that its also possible to send an empty mail with only the "from" and "to" e-mail addresses.
get_msg_str()
This method is used to output all messages (from the array $msg) created while using the class.
This example will send a short text type e-mail with to attachments to three e-mail addresses (to, Cc and Bcc).
Check the other example files for more advanced e-mail examples.