branch prepared
[mailer.git] / inc / phpmailer / README
1 PHPMailer\r
2 Full Featured Email Transfer Class for PHP\r
3 ==========================================\r
4 \r
5 ** NOTE:\r
6 \r
7 As of November 2007, PHPMailer has a new project team headed by industry\r
8 veteran Andy Prevost (codeworxtech). The first release in more than two\r
9 years will focus on fixes, adding ease-of-use enhancements, provide\r
10 basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility\r
11 features. A new release is planned before year-end 2007 that will provide\r
12 full compatiblity with PHP4 and PHP5, as well as more bug fixes.\r
13 \r
14 We are looking for project developers to assist in restoring PHPMailer to\r
15 its leadership position. Our goals are to simplify use of PHPMailer, provide\r
16 good documentation and examples, and retain backward compatibility to level\r
17 1.7.3 standards.\r
18 \r
19 If you are interested in helping out, visit http://sourceforge.net/phpmailer \r
20 and indicate your interest.\r
21 \r
22 **\r
23 \r
24 http://phpmailer.sourceforge.net/\r
25 \r
26 This software is licenced under the LGPL.  Please read LICENSE for information on the\r
27 software availability and distribution.\r
28 \r
29 Class Features:\r
30 - Send emails with multiple TOs, CCs, BCCs and REPLY-TOs\r
31 - Redundant SMTP servers\r
32 - Multipart/alternative emails for mail clients that do not read HTML email\r
33 - Support for 8bit, base64, binary, and quoted-printable encoding\r
34 - Uses the same methods as the very popular AspEmail active server (COM) component\r
35 - SMTP authentication\r
36 - Native language support\r
37 - Word wrap, and more!\r
38 \r
39 Why you might need it:\r
40 \r
41 Many PHP developers utilize email in their code.  The only PHP function\r
42 that supports this is the mail() function.  However, it does not expose\r
43 any of the popular features that many email clients use nowadays like\r
44 HTML-based emails and attachments. There are two proprietary\r
45 development tools out there that have all the functionality built into\r
46 easy to use classes: AspEmail(tm) and AspMail.  Both of these\r
47 programs are COM components only available on Windows.  They are also a\r
48 little pricey for smaller projects.\r
49 \r
50 Since I do Linux development I\92ve missed these tools for my PHP coding.\r
51 So I built a version myself that implements the same methods (object\r
52 calls) that the Windows-based components do. It is open source and the\r
53 LGPL license allows you to place the class in your proprietary PHP\r
54 projects.\r
55 \r
56 \r
57 Installation:\r
58 \r
59 Copy class.phpmailer.php into your php.ini include_path. If you are\r
60 using the SMTP mailer then place class.smtp.php in your path as well.\r
61 In the language directory you will find several files like \r
62 phpmailer.lang-en.php.  If you look right before the .php extension \r
63 that there are two letters.  These represent the language type of the \r
64 translation file.  For instance "en" is the English file and "br" is \r
65 the Portuguese file.  Chose the file that best fits with your language \r
66 and place it in the PHP include path.  If your language is English \r
67 then you have nothing more to do.  If it is a different language then \r
68 you must point PHPMailer to the correct translation.  To do this, call \r
69 the PHPMailer SetLanguage method like so:\r
70 \r
71 // To load the Portuguese version\r
72 $mail->SetLanguage("br", "/optional/path/to/language/directory/");\r
73 \r
74 That's it.  You should now be ready to use PHPMailer!\r
75 \r
76 \r
77 A Simple Example:\r
78 \r
79 <?php\r
80 require("class.phpmailer.php");\r
81 \r
82 $mail = new PHPMailer();\r
83 \r
84 $mail->IsSMTP();                                      // set mailer to use SMTP\r
85 $mail->Host = "smtp1.example.com;smtp2.example.com";  // specify main and backup server\r
86 $mail->SMTPAuth = true;     // turn on SMTP authentication\r
87 $mail->Username = "jswan";  // SMTP username\r
88 $mail->Password = "secret"; // SMTP password\r
89 \r
90 $mail->From = "from@example.com";\r
91 $mail->FromName = "Mailer";\r
92 $mail->AddAddress("josh@example.net", "Josh Adams");\r
93 $mail->AddAddress("ellen@example.com");                  // name is optional\r
94 $mail->AddReplyTo("info@example.com", "Information");\r
95 \r
96 $mail->WordWrap = 50;                                 // set word wrap to 50 characters\r
97 $mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments\r
98 $mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name\r
99 $mail->IsHTML(true);                                  // set email format to HTML\r
100 \r
101 $mail->Subject = "Here is the subject";\r
102 $mail->Body    = "This is the HTML message body <b>in bold!</b>";\r
103 $mail->AltBody = "This is the body in plain text for non-HTML mail clients";\r
104 \r
105 if(!$mail->Send())\r
106 {\r
107    echo "Message could not be sent. <p>";\r
108    echo "Mailer Error: " . $mail->ErrorInfo;\r
109    exit;\r
110 }\r
111 \r
112 echo "Message has been sent";\r
113 ?>\r
114 \r
115 CHANGELOG\r
116 \r
117 See ChangeLog.txt\r
118 \r
119 Download: http://sourceforge.net/project/showfiles.php?group_id=26031\r
120 \r
121 Andy Prevost\r