[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Looking for simple mail class

Posted on 2008-10-08
2
Medium Priority
?
161 Views
Last Modified: 2012-05-05
I am aware of many email classes like phpmailer and swiftmailer but these are all complex with many files.

I am looking for a simple PHP mail class that only uses sendmail (NOT SMTP) and fits in just ONE php file.

It should send proper headers and should guard against common attacks.

Any ideas?
0
Comment
Question by:hankknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Assisted Solution

by:Lordgobbledegook
Lordgobbledegook earned 800 total points
ID: 22669678
I use phpmailer but my understanding is that you do not need the entire distribution.  I currently have 3 files and it works fine.  If you are just using sendmail then you can probably just use class.phpmailer.php and no other files.
0
 
LVL 3

Accepted Solution

by:
DerkArts earned 1200 total points
ID: 22673833
Agreed, phpmailer is excellent, see this:

You can find full documentation anywhere. This is all i use to send emails.

(You do need a second file, class.smtp.php, that makes 2 file total)
require("class.phpmailer.php");
 
$mail = new phpmailer();
 
$mail->From     = "list@example.com";
$mail->FromName = "List manager";
$mail->Host     = "smtp1.example.com";
$mail->Mailer   = "smtp";
$body  = "Test EMail body <b>can be HTML</b>";
$mail->Body    = $body;
$mail->AddAddress("test@test.com");
$mail->AddCC("testcc@test.com");
 
if(!$mail->Send())
        echo "There has been a mail error";

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question