1
/*******************************************************************
2
* The http://phpmailer.codeworxtech.com/ website now carries a few *
3
* advertisements through the Google Adsense network. Please visit *
4
* the advertiser sites and help us offset some of our costs. *
6
********************************************************************/
9
Full Featured Email Transfer Class for PHP
10
==========================================
12
Version 5.1 (October xx, 2009)
14
Notable differences between PHPMailer and PHPMailer Lite:
15
- PHPMailer Lite does not include support for SMTP
16
- PHPMailer Lite supports Sendmail (or Qmail) by default
17
- PHPMailer Lite requires one single file (if you need language support,
18
use the language files from PHPMailer - the only difference in language
19
files is PHPMailer Lite does not include any SMTP messages)
21
We also have created a new test script (see /test) that you can use
22
right out of the box. Copy the /test folder directly to your server (in
23
the same structure ... with class.phpmailer-lite.php in the folder above it.
24
Then launch the test script with:
25
http://www.yourdomain.com/phpmailer/test/index.php
26
from this one script, you can test your server settings for mail(), or sendmail
27
(or qmail). This will email you a sample email (using contents.html for
28
the email body) and two attachments. One of the attachments is used as an inline
29
image to demonstrate how PHPMailer will automatically detect if attachments are
30
the same source as inline graphics and only include one version. Once you click
31
the Submit button, the results will be displayed including send status. We will
32
also display a version of the script that you can cut and paste to include in
37
This software is licenced under the LGPL. Please read LICENSE for information on the
38
software availability and distribution.
41
- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs
42
- Multipart/alternative emails for mail clients that do not read HTML email
43
- Support for 8bit, base64, binary, and quoted-printable encoding
44
- Uses the same methods as the very popular AspEmail active server (COM) component
45
- Word wrap, and more!
47
Why you might need it:
49
Many PHP developers utilize email in their code. The only PHP function
50
that supports this is the mail() function. However, it does not expose
51
any of the popular features that many email clients use nowadays like
52
HTML-based emails and attachments. There are two proprietary
53
development tools out there that have all the functionality built into
54
easy to use classes: AspEmail(tm) and AspMail. Both of these
55
programs are COM components only available on Windows. They are also a
56
little pricey for smaller projects.
58
Since I do Linux development I�ve missed these tools for my PHP coding.
59
So I built a version myself that implements the same methods (object
60
calls) that the Windows-based components do. It is open source and the
61
LGPL license allows you to place the class in your proprietary PHP
66
Copy class.phpmailer-lite.php into your php.ini include_path.
68
That's it. You should now be ready to use PHPMailer!
73
require("class.phpmailer-lite.php");
75
$mail = new PHPMailerLite();
77
$mail->SetFrom('you@yourdomain.com', 'Your Name');
79
$mail->AddAddress("josh@example.net", "Josh Adams");
80
$mail->AddAddress("ellen@example.com"); // name is optional
82
$mail->WordWrap = 50; // set word wrap to 50 characters
83
$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
84
$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
85
$mail->IsHTML(true); // set email format to HTML
87
$mail->Subject = "Here is the subject";
88
$mail->Body = "This is the HTML message body <b>in bold!</b>";
89
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
93
echo "Message could not be sent. <p>";
94
echo "Mailer Error: " . $mail->ErrorInfo;
98
echo "Message has been sent";
105
Download: http://sourceforge.net/project/showfiles.php?group_id=26031