Re: PHP SMTP Mailers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



King Coffee wrote:
Hi,

I'm executing a third-parity standard PHP application on a Windows IIS 7 shared hosting server.

I need to convert, or use, a SMTP mailer service. I found two SMTP PHP scripts - I think may work.

The sourceforge.net PHPMailer project and the pear.php.net (Mail, Net_SMTP) project.

Can any body please help me choose one and probably give a code snip of useage?

Currently, I'm leaning forward the PHPMailer, with little to base the decision on.

Thanks in advanced,
King Coffee


I use phpmailer and find it to be painless and consistent.

I extend the class and call the extended class:

<?php
require("class.phpmailer.php");

class MyMailer extends PHPMailer {
    // Set default variables for all new objects
    var $From     = "zonata@xxxxxxxxxxxxxxx";
    var $FromName = "Lampro P. Eltis";
    var $ReplyTo  = "mpeters@xxxxxxx";
    var $Host     = "localhost";
    var $Mailer   = "smtp";      // Alternative to IsSMTP()
    var $WordWrap = 75;
}
?>

Then when I want to use it -

$mail = new MyMailer();
$mail->Subject  = "Some Subject";
$mail->Body = "Some content";
if($mail->Send()) {
   // it was successfully sent, code on success here
   } else {
   // there was an error, error code here
   }

I never send HTML mail or attachments or bulk mail, but I believe it is capable of doing them quite easily.

Tip: Whatever solution you use, set the wordwrap to something that works well on an 80 char display. Some clients do not autowrap unwrapped messages and other clients wrap for display but when replying, it doesn't wrap.

I use 75 because it gives a little room for the "> " that accompanies a reply.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux