<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Forum posts to 'Archive'</title>
		<link>http://www.silverstripe.org/archive/rss</link>
		<atom:link href="http://www.silverstripe.org/archive/rss" rel="self" type="application/rss+xml" />
		<description></description>

		
		<item>
			<title>Re: How to use PHP Mailer in SS</title>
			<link>http://www.silverstripe.org/archive/show/43027?start=0#post231468</link>
			<description>&lt;p&gt;Hi guys,&lt;/p&gt;&lt;p&gt;I just did this to get my forms to send mails, and it worked lige a charm! &lt;br /&gt;SS v. 2.2.3&lt;br /&gt;Both forms and newsletters ship of nicely!!&lt;/p&gt;&lt;p&gt;THANKS!!!&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: How to use PHP Mailer in SS &lt;a href=&quot;http://www.silverstripe.org/archive/show/43027?start=0#post231468&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/43027?start=0#post231468&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Wed, 19 Nov 2008 06:55:46 +1300</pubDate>
			<dc:creator>jacobsjensen</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/43027?start=0#post231468</guid>
		</item>
		
		<item>
			<title>[Solved] How to use PHP Mailer in SS</title>
			<link>http://www.silverstripe.org/archive/show/43027?start=0#post178588</link>
			<description>&lt;p&gt;OK ... I am way over my head ... but did get this to work.&lt;/p&gt;&lt;p&gt;I inserted the Step 5 Code in Email.php right after :&lt;/p&gt;&lt;p&gt;// TO DO: Clean this code up, make it more OO.&lt;br /&gt;// For now, we've just put a clean interface around this dirty code  &lt;img src='http://www.silverstripe.org/sapphire/images/smilies/smile.gif'&gt; &lt;/p&gt;&lt;p&gt;I chose that position becasue it was right before the function htmlEmail which is the &quot;else&quot; part of the step 4 code mod.  It may not be optimal, but it is working.&lt;/p&gt;&lt;p&gt;I also placed the folder for PhPMailer as phpmailer in both the www and the mysite directories ... again not efficient to have this in both places, but it is working now.&lt;/p&gt;&lt;p&gt;To be honest, for a product that is advertised as &quot;When developing a SilverStripe website you'll be staying up all night because you're having fun, not because you're stuck or moving at a slow pace. &quot; I am seriously disappointed by the large amount of custom modification I have had to make to get SS features to actually function on my server.&lt;/p&gt;&lt;p&gt;This leaves me VERY concerned about upgrades when they come as that will probably necessitate re-working these custom mods.&lt;/p&gt;&lt;p&gt;All I haveto say is THANK GOD these forums are here ... as I've spent hours researching, reading, and implementing fixes documented here to this &quot;easy&quot; and &quot;fun&quot; product.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: How to use PHP Mailer in SS &lt;a href=&quot;http://www.silverstripe.org/archive/show/43027?start=0#post178588&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/43027?start=0#post178588&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Sun, 21 Sep 2008 04:09:09 +1200</pubDate>
			<dc:creator>JamesinCO</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/43027?start=0#post178588</guid>
		</item>
		
		<item>
			<title>Re: How to use PHP Mailer in SS</title>
			<link>http://www.silverstripe.org/archive/show/43027?start=0#post178582</link>
			<description>&lt;p&gt;OK ... I tried this and get this error.&lt;/p&gt;&lt;p&gt;Parse error: syntax error, unexpected T_CLASS, expecting T_FUNCTION in /home/dsamwm/public_html/sapphire/core/Email.php on line 412&lt;/p&gt;&lt;p&gt;I presume that I modified the Email.php file incorrectly as I did not fully understand &quot;Step 5&quot; of the fix.&lt;/p&gt;&lt;p&gt;Where exactly do you add that code in the Email.php file to get it to work?  If someone could please tell me what line do I need to find and insert the step 5 code after to make this work it would be great.&lt;/p&gt;&lt;p&gt;Also .... when you say the 'project root' in setp 2 ... do you mean www or the 'mysite' subdirectory?&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: How to use PHP Mailer in SS &lt;a href=&quot;http://www.silverstripe.org/archive/show/43027?start=0#post178582&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/43027?start=0#post178582&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Sun, 21 Sep 2008 03:43:34 +1200</pubDate>
			<dc:creator>JamesinCO</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/43027?start=0#post178582</guid>
		</item>
		
		<item>
			<title>How to use PHP Mailer in SS</title>
			<link>http://www.silverstripe.org/archive/show/43027#post43027</link>
			<description>&lt;p&gt;I was having some problems to work mail function in a shared hosting.&lt;br /&gt;See my &lt;a href=&quot;http://www.silverstripe.com/site-builders-forum/flat/34675&quot;&gt;message&lt;/a&gt;&lt;br /&gt;So I decided to use PHP Mailer in SS, and here are the steps to do it.&lt;/p&gt;&lt;p&gt;1) Download &lt;a href=&quot;http://phpmailer.codeworxtech.com/&quot;&gt;PHP Mailer&lt;/a&gt;&lt;br /&gt;    I downloaded &lt;a href=&quot;http://sourceforge.net/project/showfiles.php?group_id=26031&quot;&gt;phpmailer for php5 &lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;2) Uncompress it to your SS project root.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Rename the uncompressed directory, something like &lt;strong&gt;PHPMailer_v2.X.Y&lt;/strong&gt;, to &lt;strong&gt;phpmailer&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;3) Open your _config.php file&lt;br /&gt;     Add this code in the file:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;   /* { PHPMAILER */&lt;br /&gt;   $path = Director::baseFolder().'/phpmailer/';&lt;br /&gt;   set_include_path(get_include_path() . PATH_SEPARATOR . $path);&lt;br /&gt;   require_once 'class.phpmailer.php';&lt;br /&gt;   global $phpmailer;&lt;br /&gt;   $phpmailer = new PHPMailer();&lt;br /&gt;   $phpmailer-&amp;gt;CharSet = &quot;UTF-8&quot;;&lt;br /&gt;   $phpmailer-&amp;gt;IsSMTP();                                   // send via SMTP&lt;br /&gt;   $phpmailer-&amp;gt;Host     = &quot;smtp.example.com&quot;; // SMTP servers&lt;br /&gt;   $phpmailer-&amp;gt;SMTPAuth = true;     // turn on SMTP authentication&lt;br /&gt;   $phpmailer-&amp;gt;Username = &quot;username&quot;;  // SMTP username&lt;br /&gt;   $phpmailer-&amp;gt;Password = &quot;password&quot;; // SMTP password&lt;br /&gt;   $phpmailer-&amp;gt;From     = &quot;username@example.com&quot;;&lt;br /&gt;   $phpmailer-&amp;gt;FromName = &quot;My From Text&quot;;&lt;br /&gt;   /* PHPMAILER } */&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;This is the basical configuration of PHP Mailer.&lt;/p&gt;&lt;p&gt;4) Open sapphire/core/Email.php&lt;br /&gt;    Go to &lt;strong&gt;send&lt;/strong&gt; function and search this line:&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;   $result = htmlEmail($to, $this-&amp;gt;from, $subject, $this-&amp;gt;body, $this-&amp;gt;attachments, $this-&amp;gt;plaintext_body, $headers);&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;    replace the line with this lines:&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;   global $phpmailer;&lt;br /&gt;   if ($phpmailer)&lt;br /&gt;      $result = htmlEmail_phpMailer($to, $this-&amp;gt;from, $subject, $this-&amp;gt;body, $this-&amp;gt;attachments, $this-&amp;gt;plaintext_body, $headers);&lt;br /&gt;   else &lt;br /&gt;      $result = htmlEmail($to, $this-&amp;gt;from, $subject, $this-&amp;gt;body, $this-&amp;gt;attachments, $this-&amp;gt;plaintext_body, $headers);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;5) Add this new function to Email class:&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;   function htmlEmail_phpMailer($to, $from, $subject, $htmlContent) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;      global $phpmailer;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;      $to = validEmailAddr($to);&lt;br /&gt;      $phpmailer-&amp;gt;ClearAddresses();&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;      $phpmailer-&amp;gt;AddAddress($to); &lt;br /&gt;      $phpmailer-&amp;gt;IsHTML(true);                     // send as HTML&lt;br /&gt;      $phpmailer-&amp;gt;Subject  =  $subject;&lt;br /&gt;      $phpmailer-&amp;gt;Body     =  $htmlContent;&lt;br /&gt;      if(!$plainContent) &lt;br /&gt;         $plainContent = Convert::xml2raw($htmlContent);&lt;br /&gt;      $phpmailer-&amp;gt;AltBody = $plainContent;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;      if(!$phpmailer-&amp;gt;Send())&lt;br /&gt;         return false;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;      else&lt;br /&gt;         return true;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;   }&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Now SS will send mails using PHP Mailer.&lt;br /&gt;I only test it with forms and it works good. I test it on SS 2.2.1&lt;br /&gt;Maybe it has some errors (any help to solve them is welcomed), but for me it works great.&lt;/p&gt;&lt;p&gt;Hope this helps someone.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: How to use PHP Mailer in SS &lt;a href=&quot;http://www.silverstripe.org/archive/show/43027#post43027&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/show/43027#post43027&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Wed, 12 Mar 2008 23:37:32 +1300</pubDate>
			<dc:creator>nomen</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/43027#post43027</guid>
		</item>
		

	</channel>
</rss>