Class.phpmailer.php & Class.smtp.php ?
class.phpmailer.php & class.smtp.php ?
Hi friend,
anybody tried class.phpmailer.php & class.smtp.php to
sendmail?
I try to connect to mail.yahoo.com, not working.
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
// set mailer to use SMTP
$mail->Host = "smtp1.example.com;smtp2.example.com";
// specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP
authentication
$mail->Username = "jswan"; // SMTP username
$mail->Password = "secret"; // SMTP password
$mail->From = "from@...";
$mail->FromName = "Mailer";
$mail->AddAddress("josh@...", "Josh Adams");
$mail->AddAddress("ellen@...");
// name is optional
$mail->AddReplyTo("info@...", "Information");
$mail->WordWrap = 50;
// set word wrap to 50 characters
$mail->AddAttachment("/var/tmp/file.tar.gz");
// add attachments
$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
// optional name
$mail->IsHTML(true);
// set email format to HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in
bold!</b>";
$mail->AltBody = "This is the body in plain text for
non-HTML mail clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
View Complete Forum Thread with Replies
Related Forum Messages:
PHPMailer Class
Is anyone using phpmailer class from SourceForge and feeding the mailer from a DB? any problems that you know of? any security issue? I might give it a try but would like hearing about your experience before digging in it .
View Replies !
Phpmailer Language Class
I have been having problems with the phpmailer language class. When I use it to send out mass emails or to send out auto responses some of the emails do not send and it gives me this error message. If I am using it in a mass mailer the whole list wont send out. X-Powered-By: PHP/4.2.2 Content-type: text/html testMessage could not be sent. <p>Mailer Error: Language string failed to load: from_failedemailaddress@domain.com.
View Replies !
Copy Class.phpmailer.php Into Your Php.ini Include_path.
I'm trying to install phpmailer because of its SMTP authentication purposes and i haven't had any luck authenticating any other ways. In the installation instructions it says to "Copy class.phpmailer.php into your php.ini include_path." How do first of all find my php.ini file and secondly how do i copy into it? (The site is hosted on a web server so i never understand when i hear to find the php.ini on your hard drive.).
View Replies !
Phpmailer Class Converted To Plain On Some Servers...
I am using a phpmailer class to send some forms over the email... And the problem is, that some ppl (especially problematic for me is the buyer....) getting the email as rough data (sorce...) here is the emal itself as they get it (the headers are below...) Code: X-Tour4Less.co.il Mailer: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_27976937fb6a931b3ed2d40aebd76a26" --b1_27976937fb6a931b3ed2d40aebd76a26 Content-Type: text/plain; charset = "windows-1255" Content-Transfer-Encoding: 8bit рйсйеп тбшйъ --b1_27976937fb6a931b3ed2d40aebd76a26 Content-Type: text/html; charset = "windows-1255" Content-Transfer-Encoding: 8bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<html> <head> and the rest of the email... and here is the headers... Code: ESMTP; 01 Sep 2006 12:11:23 -0000 Received: (qmail 32712 invoked from network); 1 Sep 2006 05:11:23 -0700 Received: from localhost (HELO http://www.tour4less.co.il) (127.0.0.1) by localhost with SMTP; 1 Sep 2006 05:11:23 -0700 Received: from phpmailer ([88.153.9.8]) by http://www.tour4less.co.il with HTTP (PHPMailer); Fri, 1 Sep 2006 05:11:23 -0700 Date: Fri, 1 Sep 2006 05:11:23 -0700 To: undisclosed-recipients:; From: "Tour4less.co.il" <########## // here was an email i delited... Subject: Contact Email from Tour4Less.co.il Message-ID: <27976937fb6a931b3ed2d40aebd76a26@www.tour4less.co. il> X-Priority: 3 X-Mailer: PHPMailer [version 1.71] X-Virus-Scanned: amavisd-new at sce.ac.il Return-Path: ############## // here was an email i delited... X-OriginalArrivalTime: 01 Sep 2006 12:11:02.0551 (UTC) FILETIME=[B168A270:01C6CDBF]
View Replies !
Phpmailer.class Messages Are Been Converted To Plain Text...
I am using a phpmailer class to send some staff over the email... I am tring to send it with text/html but for some reason the email are been converted to plain and all the headers are shown, here is the email... X-Tour4Less.co.il Mailer: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_27976937fb6a931b3ed2d40aebd76a26" --b1_27976937fb6a931b3ed2d40aebd76a26 Content-Type: text/plain; charset = "windows-1255" Content-Transfer-Encoding: 8bit *יסיון עברית --b1_27976937fb6a931b3ed2d40aebd76a26 Content-Type: text/html; charset = "windows-1255" Content-Transfer-Encoding: 8bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<html> <head> <META HTTP-EQUIV="Content-Type" content="text/html; charset=windows-1255"</head<body<p dir=RTL><span lang=HE>שלום חברת Tour4less contact .</span></p<p dir=RTL><span lang=HE>משתמש של האתר שלנו </span><span dir=LTR>TOUR4LESS.CO.IL</span><span dir=RTL></span><span lang=HE><span dir=RTL></spanהתעניין ביצירת קשר איתו ע"י.........
View Replies !
Class.smtp.php Timeout
im using joomla and VirtueMart and when i go through the order process and click on the confirmation page.. i get the following error Fatal error: Maximum execution time of 60 seconds exceeded in D:Program Filesxampphtdocsadministratorcomponentscom_virtuemartclassesphpmailerclass.smtp.php on line 372 any ideas what to do?
View Replies !
Class For Easy Smtp Mailing?
does anyone know a php class for easy smtp-sending? Class would only need to be able to send textmails and should be really easy for a guy like me (not much php knowledge) to be integrated...
View Replies !
Defining A Class/instantiating Object Inside A Method Of Another Class
I have a class. Inside the class I have a method that reads a text file. In the text file I have a class name and a file name where that class is defined. Now, I need to instantiate an object of that class, the problem being that at the time I find out the class name and the file name, I'm inside a method of another class. Well, let me just type up a little example:
View Replies !
Child Class Member's Iteration By Parent Class
I have a class that has a few private members. Is there a way to create a function in its parent class that can access its (child's) private members. With the following code I am able to get only the public and protected members. class parentIter { function iterateProps ( ) { foreach ( $this as $propName => $propValue ) { echo "<br>$propName => $propValue" ; } } } class childIter extends parentIter { protected $var1 = 'protected var' ; private $var2 = 'private var' ; public $var3 = 'public var' ; function iterateProps ( ) { parent::iterateProps () ; } } $obj = new childIter () ; $obj->iterateProps ( ) ;
View Replies !
PHP5: Can A Class Inherit Initialized Classvariable From Another Class?
I got following problem trying to inherit a variable from another class class Core { public $obj; function initialize($obj) { $this->obj = $obj; } } class test extends Core { function test() { echo $this->obj; // or echo parent::$obj; // ?? } } $core = new Core $core->initialize('hello'); $test = new test $test->test(); As far as what I would like to get, I would see 'hello', but instead I get following error: Fatal error: Access to undeclared static property: Core::$obj (echo parent::$obj;) After declaring $obj as public and static I don't get any result as well.. Is it possible to inherit already initialized variables from a different class or are there design patterns who could do something like that? I hope it is clear where I want to go with this.. I am doing this because I can't give the class test any parameters because it could be extended (class woow extends test). Also the amount of variables is not certain and there might be lots of classes needing to inherit the variables. That would mean that I would have to change every class if a parameter would change..
View Replies !
Access Class Member Function Without Instantiating Class?
I need to access a class member function from outside the class, and hopefully without having to instantiate the class if possible? I have an HTML form <select> and each <option> item is being pulled from an array stored in a mysql db. But I'm doing this independently of the normal purpose of the class itself, I just want to use that member function.
View Replies !
Date :: Class Starts And The Time A Class Ends
I have a registeration system set up. The user registers the time a class starts and the time a class ends. These times are stored in mysql db with time type. How do I prevent double booking in this situation? e.g. If the class starts at 9:00 and ends at 10:30, how do I ensure that no class takes place between those times.
View Replies !
Calling Class Method Of Variable Class.
Yes, it's the week of OO here in c.l.php If I want to call the method a class (not an object), one normally uses: classname::method(); which works fine. However, what if I don't know the classname yet? $classname::method(); doesn't work, neither does {$classname}::method(); I've got solved it like this now: call_user_func(array($classname,'method'));
View Replies !
Invoke Function From Initiated Class Within A Class
<?php //clsrecordset.php class Recordset extends Database{ public function Recordset( ) { } public function query( ) { } public function endOfFile ( ) { } } ?> <?php //clssearchindex.php require_once('clsrecordset.php'); class Searchindex { private c_rs; public function Searchindex ( ) { $this->c_rs = new Recordset( ); } public function getSQL ( ) { } public function getData ( ) { $rs = $this->c_rs->query($this->getSQL()); // error occurred this line $this->c_rs->query($this->getSQL()); if ( $this->c_rs->endOfFile() ) { $norecs = true; } } } ?> Error message: Call to a member function query() on a non-object Additional, when I type the $this->c_rs-> , there is no intellisense on this case that's why I know there is something wrong and couldn't find the function. Help: How can I call the function from the initiated class in order to use in other class?
View Replies !
Phpmailer/smtp
my phpmailer script, which emails a cart confirmation to a customer, does not work every now and then. However, I've identified when this happens, and am guessing at the problem. At work, we have wireless connectivity, and the way they have their wireless setup, I can NOT send mail, via outlook, using my websites smtp server. The wireless connection at work FORCES me to use their smtp server in order to send mail via outlook. And this is where i have problems with phpmailer. So is this because of the same reason? Is it because the phpmailer uses smtp and the isp that i am using here at work will not allow me to use another smtp other than theirs?
View Replies !
PHP 4: Does Method_exist Return True If Parent Class Method Even If Child Class Forgot To Call Parent::
My code was dying on the line below where I use method_exists: if (class_exists($nameOfClassToBeUsed)) { $object = new $nameOfClassToBeUsed(); $this->arrayOfAllTheObjectsSoFarLoaded[$nameOfClassToBeUsed] = & $object; if (method_exists($object, "setCallingCode")) $object->setCallingCode($nameOfFunctionOrClassCalling); return $object; } else { $this->error("$nameOfClassToBeUsed not found. The code that wants this class is $nameOfFunctionOrClassCalling "); } The method is in the parent class yet I'd forgotten to call parent:: in the constructor of the child class. It seems to me that method_exists was testing true, though the method was not truly available, and then the code died. Adding parent:: to the constructor of the child solved the problem. Is this a bug in PHP?
View Replies !
Coding A Class' Function Outside A Class
I still haven't found if there is a way to write functions (methods) that belong to a class, outside of that. Maybe there is not, at least untill now.But I prefered to post a question here about that in case there is and someone knows.
View Replies !
Use External Class In A Static Class
I have a language class with a static method so it can be accesed without instantiation for use all over the shop... anyway I am using the oop mysqli and wanted to know how to make this available this inside the static method.
View Replies !
Including A Class File In Another Class
Trying to figure out a way that my static field $Source can recognize the Enum class...at present, it doesn;t work with the include statement (where it is located now), when the Enum class is instantiated...any ideas? Code:
View Replies !
Calling An Outer Class From An Inner Class
okay, so i have a class called $superclass inside superclass, i call and initialize another class called $tpl ($superclass->tpl) superclass contains a few different classes. Inside tpl i need to use another class that superclass is including. How do I do this?
View Replies !
PHPMailer And Remote SMTP
I'm using PHPMailer to send out emails and I want to use my ISP SMTP server to send those emails since where my website is hosted, it says 'Email sent on behalf of' in the message ... yes, it's a shared hosting. I'm using this code to send mails; PHP Code:
View Replies !
PHPMailer SMTP Mail
I am trying to send emails via a PHP script and I am trying to avoid the spam filters. I have used the mail() function which seems to be the worst of all solutions. I have tried SMTP emailing via PHPMailer, and some address wont receive the emails, and 1/10 hotmail attempts will get through, the rest wont even appeaer in the junk folder. All the email contains is SUBJECT: "Linxsmart Document" BODY: " Hello <<Dynamic Name>>,
View Replies !
PHPmailer - SMTP Vs Mail & Time Out
I am trying to send out 50,000 + emails through PHPmailer. I am using the $mail->Send();. Is it better to use SMTP so my server won't get blocked for spam? Is SMTP better for the server resources, it's a lot of HTML mail going out? The PHPmailer program does not seem to be sending out all the emails and it seems to time out. Is this due to the max_execution_time in the php configuration? Or has anyone used the PHPmailer to send out over 100,000+ emails? Our email list is growing and I need to make sure all emails are going out.
View Replies !
Class Inside Another Class 4
I've got a strange situation. I've got class Handlers it's only: class Handlers { var $DB; var $XML; } In my PHP script I want to do sth like this: $Main = new Handlers(); $Main->DB = new DataBase(); $Main->XML = new XML(); but when inside eg. CreateNode method in XML class I want to run query using: $this->DB->RunQuery(); it's of course fatal error... I saw in one script that such classes can be created but i don't remember where I found it... Can it be writen in PHP 4?
View Replies !
Class Inside Class
I'm developing a menu class, and in it, I want to use my sql wrapper, which is also a class. I quickly found out that I'm unable to call a class inside another class. It has been suggested that I tell my menu class to extend my sql class, but it makes no logical sense for a menu to extend a db. So my question is, are there any other ways to access my sql class's functions inside another class?
View Replies !
Class Can Not Inherit From Another Class, Why ?
I am using this very slightly modified function found here: http://us2.php.net/mysql_fetch_object to make mySQL rows into objects of type $classname: // This takes db result rows and makes real objects of $classname type function &buildObj($result, $classname) { while($row = mysql_fetch_assoc($result)) { if ($row === null) return null; /* Create the object */ $obj =& new $classname; /* Explode the array and set the objects's instance data */ foreach($row as $key => $value) { $obj->{$key} = $value; } $objs[] = $obj; } return $objs; } This is called by a retrieve: function: function retrieve($where) { echo $query = "SELECT * FROM $this->table WHERE " . join(' AND ', $where); $result = mysql_query($query); $rows =& buildObj($result, get_class($this)); mysql_free_result($result); return $rows; } The problem I am encountering is that if I do this in my script: $listing = new Listing; $listings = $listing->retrieve(array('row > 1') ); foreach ($listing as $aListing) { $aListing->address='xxxxxxxxxxxxx' } foreach ($listing as $aListing) { print_r($aListing); } The value in $aListing->address is unchanged. However if I do this: $listing = new Listing; $listings = $listing->retrieve(array('row > 1') ); foreach ($listing as $aListing) { $aListing->address='xxxxxxxxxxxxx' $newArray[] = $aListing; } foreach ($newArray as $aListing) { print_r($aListing); } I see the update values in $aListing->address .
View Replies !
Database Class Within A Other Class
Im rewriting a script of mine into PHP5 OOP. Even tho I have some difficults finding a good way. I have a Class for database connections/functions (clsDB) and a Class for Statistics (clsStats) So my question is, whats the best way to use the DB functions within the Stats class? Code:
View Replies !
Using Mysql Class In Another Class
I'm trying to call up a connection/query class into another class. The 'another' class is clearly working with the 'connquery' but it's throwing this error at me: Fatal error: Call to undefined method Published::query() in /Library/Apache2/htdocs/sys/libs/class.mysql.php on line 63 The issue, I believe, is that the 'connquery' class is not passing the connection variables along to the new class - I'm not sure why. When I test the connquery class on it's own (outside the another class) it works just fine. So, missing vars... 'global' is not working here either to get them in the class. What am I missing? Code:
View Replies !
Loading A Class From A File - Dynamic Class Loading
I want to load a class from a file, and I have tried to do so with little success. Here's a sample of my code: include("CMWebServiceImpl.class.php"); $fs=newfilesystem(); $data=$fs->readFile("/home/keeb/test.res","r"); $x=new$data("http://192.168.2.37/services/Router?wsdl"); This returns Fatal error: Class 'CMWebServiceImpl ' not found in /home/keeb/projects/php/cmsService/classes/classFromFile.php on line 10 However, this is not the case, since I can call with success: $y=newCMWebServiceImpl("http://192.168.2.37/services/Router?wsdl"); Anyone do anything like this before?
View Replies !
On (missing Class Method) Call Class Method X
I want to use non existing methods of a class: class x{ function y(){ } //more stuff } and do this: $x1=new x(); $x1->doesnt_exist(); but instead of a fatal error, I want to run y(), I would like a way to redirect all these errors, to y(), and have y() act depending on the method name, etc.
View Replies !
(yet Another) DB Class...
I'm rolling my own little DB class (pls, I don't need to hear about how wonder this or that class is, thank you, I've reading over 2 dozen such libaries) and I have a question to this group... Workflow: 1) submit data form 2) pull data from POST 3) "clean" data 4) update record Now, my question deals with step 3....
View Replies !
OOP DB Class
I am trying to make myslef a oop db manipulation class, but I'can seem to get anything to work. Everytime I try to do someting beside query, or connect, i get errors like invalid-result resource. PHP Code:
View Replies !
Class In A Class
Id like to know how you access variables in a subclass of the current class. For example: Code: class Cnum1 { var x;} class Cnum2 { var y; var z; function test() { $this->y = new Cnum1(); $this->y->x; // invalid - whats the alternative? }}
View Replies !
Class Example
My problem lies in implimenting classes. I get the use of them in C++ with a program that resides in memory and the class is called upon throughout the life of the program. But trying to use classes in PHP for me is another story. I get using small classes for abstraction (ie. database classes). But writing a web app with classes just seems to elude me. Can any direct me to a medium size open source project that in your opinion is a good example that I may use for study. And I know about phpclasses.org but I'm looking for a complete project to help me in implimentation.
View Replies !
PHP Class...
Ive written a PHP class that sends mail through the SMTP server, it's works fine, but there's a small bug in the class that i cant seem to solve, can anyone help us out. The problem happens in the DATA function of the class, it should iterate through an array and put the recipents email in the To: field, but it doesn't work the way it should.
View Replies !
PHP Class
What are PHP Class used in every day coding? and can some explain into detail how to use them?
View Replies !
Using Class
i have one class as database wrapper and i need to use this class from another class.i hear that i need to create one object to call that class.but i have used like thatbut its not working i dont know whether its right or wrong. Code:
View Replies !
What Is A PHP Class?
What is a PHP class? I've seen a lot of talk about these and how they can help you out, but I've never seen a very good explanation. I've been working with PHP for just over 6 months and usually hard code everything into my scripts. Recently I've begun putting frequently-used things (like my MySQL connect function) in a seperate file and including them. But I still haven't seen the use of classes or even functions for that matter. And one more thing - how do you set up a function to accept variables?
View Replies !
Use A Class
why you use classes in some instances rather than functions. I have never used a class, but I use a lot of functions. I don't have a comp sci background, so I may miss some of the basics.
View Replies !
OOP/Class
I am an fairly experienced PHP programmer - but I am used to procedural code - Currently I am refactoring to OOP. I have 2 classes - a progressbar class and data fetcher class. In this implementation, the data fetcher need to directly access the progressbar. I could use extends, but then i cant use the datafetcher and progressbar classes independantly. What is the best way for me to achieve this?
View Replies !
Use A Class In A Class
How to use a Class in da Class? i have a database class for querying the db, and a counter class who should also be able to query the db. if i use the counter class it should create a db object like this: class counter { var $db; function counter() { $this->db = new CDatabase; } function a_query_function() { $this->db->query("some SQL"); } } but the command $this->db->query("some SQL"); doesn't work because of pointing, c syntax like ($this->db)->query("some SQL"); doesn't work too, what is the cleanest solution?
View Replies !
Get Value From Class
i've been trying to get a value from a class but i cant get it to work. I've got 2 files, one called index.php and the other class.php. Ill show you what i've been trying to do. Code:
View Replies !
Db Class
I have written a class used for extraction of data, but somehow, the part about "sql_select_db" doesn't return a proper error msg if there is an error. PHP Code: <?php //mysql db class database{ //db connection function sql_connect($dbhost,$dbuser=null,$dbpass=null){ $link = mysql_connect($dbhost,$dbuser,$dbpass); //check if able to connect to db if($link != false){ return true; return $link; } elseif($link == false){ $this->sql_error(); } } ............................
View Replies !
XML To Class
Is there any way in PHP to read an XML file in and bind the contents to an instance of a given class? I've done something similar in .NET using serialization which reads a XML config file and then automatically populates the properties of a Config object. E.g. // Create an instance of the XmlSerializer specifying type and namespace. XmlSerializer serializer = new XmlSerializer(typeof(Config)); // A FileStream is needed to read the XML document. FileStream fs = new FileStream(filename, FileMode.Open); XmlReader reader = new XmlTextReader(fs); // Use the Deserialize method to restore the object's state. Config appConfig; appConfig = (Config) serializer.Deserialize(reader); Hence you have an object called appConfig of type Config.
View Replies !
|