|
Title: SMTP setup for HCL Post by: tommyjohn on June 23, 2007, 08:23:56 PM I am trying to use SMTP in HCL, and I have configured the following page...
/hcl/class/phpmailer/class.phpmailer.php Here is the config (domains and IDs filtered of course): Code: <?php //////////////////////////////////////////////////// // PHPMailer - PHP email class // // Class for sending email using either // sendmail, PHP mail(), or SMTP. Methods are // based upon the standard AspEmail(tm) classes. // // Copyright (C) 2001 - 2003 Brent R. Matzelle // // License: LGPL, see LICENSE //////////////////////////////////////////////////// /** * PHPMailer - PHP email transport class * @package PHPMailer * @author Brent R. Matzelle * @copyright 2001 - 2003 Brent R. Matzelle */ class PHPMailer { ///////////////////////////////////////////////// // PUBLIC VARIABLES ///////////////////////////////////////////////// /** * Email priority (1 = High, 3 = Normal, 5 = low). * @var int */ var $Priority = 3; /** * Sets the CharSet of the message. * @var string */ var $CharSet = "iso-8859-1"; /** * Sets the Content-type of the message. * @var string */ var $ContentType = "text/plain"; /** * Sets the Encoding of the message. Options for this are "8bit", * "7bit", "binary", "base64", and "quoted-printable". * @var string */ var $Encoding = "8bit"; /** * Holds the most recent mailer error message. * @var string */ var $ErrorInfo = ""; /** * Sets the From email address for the message. * @var string */ var $From = "[MY EMAIL ADDY]"; /** * Sets the From name of the message. * @var string */ var $FromName = "[MY NAME]"; /** * Sets the Sender email (Return-Path) of the message. If not empty, * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. * @var string */ var $Sender = "[MY EMAIL ADDY]"; /** * Sets the Subject of the message. * @var string */ var $Subject = ""; /** * Sets the Body of the message. This can be either an HTML or text body. * If HTML then run IsHTML(true). * @var string */ var $Body = ""; /** * Sets the text-only body of the message. This automatically sets the * email to multipart/alternative. This body can be read by mail * clients that do not have HTML email capability such as mutt. Clients * that can read HTML will view the normal Body. * @var string */ var $AltBody = ""; /** * Sets word wrapping on the body of the message to a given number of * characters. * @var int */ var $WordWrap = 0; /** * Method to send mail: ("mail", "sendmail", or "smtp"). * @var string */ var $Mailer = "smtp"; /** * Sets the path of the sendmail program. * @var string */ var $Sendmail = "/usr/sbin/sendmail"; /** * Path to PHPMailer plugins. This is now only useful if the SMTP class * is in a different directory than the PHP include path. * @var string */ var $PluginDir = "/hcl/class/phpmailer/"; /** * Holds PHPMailer version. * @var string */ var $Version = "1.72"; /** * Sets the email address that a reading confirmation will be sent. * @var string */ var $ConfirmReadingTo = ""; /** * Sets the hostname to use in Message-Id and Received headers * and as default HELO string. If empty, the value returned * by SERVER_NAME is used or 'localhost.localdomain'. * @var string */ var $Hostname = ""; ///////////////////////////////////////////////// // SMTP VARIABLES ///////////////////////////////////////////////// /** * Sets the SMTP hosts. All hosts must be separated by a * semicolon. You can also specify a different port * for each host by using this format: [hostname:port] * (e.g. "smtp1.example.com:25;smtp2.example.com"). * Hosts will be tried in order. * @var string */ var $Host = "localhost"; /** * Sets the default SMTP server port. * @var int */ var $Port = 25; /** * Sets the SMTP HELO of the message (Default is $Hostname). * @var string */ var $Helo = ""; /** * Sets SMTP authentication. Utilizes the Username and Password variables. * @var bool */ var $SMTPAuth = true; /** * Sets SMTP username. * @var string */ var $Username = "[MY EMAIL ADDY]"; /** * Sets SMTP password. * @var string */ var $Password = "[MY EMAIL PASSWORD]"; /** * Sets the SMTP server timeout in seconds. This function will not * work with the win32 version. * @var int */ var $Timeout = 25; /** * Sets SMTP class debugging on or off. * @var bool */ var $SMTPDebug = false; /** * Prevents the SMTP connection from being closed after each mail * sending. If this is set to true then to close the connection * requires an explicit call to SmtpClose(). * @var bool */ var $SMTPKeepAlive = false; /**#@+ * @access private */ var $smtp = NULL; var $to = array(); var $cc = array(); var $bcc = array(); var $ReplyTo = array(); var $attachment = array(); var $CustomHeader = array(); var $message_type = ""; var $boundary = array(); var $language = array(); var $error_count = 0; var $LE = "\n"; /**#@-*/ Title: Re: SMTP setup for HCL Post by: HCL Admin on June 23, 2007, 08:36:07 PM Um, I missed the question....
Title: Re: SMTP setup for HCL Post by: tommyjohn on June 23, 2007, 08:41:39 PM Ummm, its not working, so I guess I meant to ask, is there something in this code I pasted, or elsewhere, that I need to look at?
Title: Re: SMTP setup for HCL Post by: HCL Admin on June 23, 2007, 09:32:17 PM You might turn on the SMTPdebug on, it'll help you track the errors.
Title: Re: SMTP setup for HCL Post by: HCL Admin on June 24, 2007, 03:40:47 PM Can you put a test-info.php with the following code in it and PM me the URL?
Code: <?php phpinfo(); ?> I really should add this to HCL, so we can pull up the current config. :) Title: Re: SMTP setup for HCL Post by: tommyjohn on June 24, 2007, 10:12:44 PM Sent a PM with the URL.
Title: Re: SMTP setup for HCL Post by: HCL Admin on June 24, 2007, 10:15:39 PM Everything looks good. Did you try turning the smtp logging on? I'm trying to think of some other ways to test that.
That is another part of the code I wish to rewrite, as now that I think about it, it does nothing. Title: Re: SMTP setup for HCL Post by: manubatham20 on December 02, 2010, 06:11:37 AM Sry, I posted the msg mistakenly.
|