<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>WordPress Designpraxis Forum Topic: Fatal error: Cannot redeclare class phpmailer</title>
<link>http://wpforum.designpraxis.at/</link>
<description>WordPress Designpraxis Forum Topic: Fatal error: Cannot redeclare class phpmailer</description>
<language>en</language>
<pubDate>Sat, 04 Feb 2012 04:03:25 +0000</pubDate>

<item>
<title>rol on "[closed] Fatal error: Cannot redeclare class phpmailer"</title>
<link>http://wpforum.designpraxis.at/topic/fatal-error-cannot-redeclare-class-phpmailer#post-117</link>
<pubDate>Thu, 13 Sep 2007 11:48:43 +0000</pubDate>
<dc:creator>rol</dc:creator>
<guid isPermaLink="false">117@http://wpforum.designpraxis.at/</guid>
<description>&#60;p&#62;;) You're welcome!
&#60;/p&#62;</description>
</item>
<item>
<title>Saksoy on "[closed] Fatal error: Cannot redeclare class phpmailer"</title>
<link>http://wpforum.designpraxis.at/topic/fatal-error-cannot-redeclare-class-phpmailer#post-115</link>
<pubDate>Wed, 12 Sep 2007 19:48:16 +0000</pubDate>
<dc:creator>Saksoy</dc:creator>
<guid isPermaLink="false">115@http://wpforum.designpraxis.at/</guid>
<description>&#60;p&#62;Yup, it worked thank you.
&#60;/p&#62;</description>
</item>
<item>
<title>rol on "[closed] Fatal error: Cannot redeclare class phpmailer"</title>
<link>http://wpforum.designpraxis.at/topic/fatal-error-cannot-redeclare-class-phpmailer#post-114</link>
<pubDate>Wed, 12 Sep 2007 18:23:15 +0000</pubDate>
<dc:creator>rol</dc:creator>
<guid isPermaLink="false">114@http://wpforum.designpraxis.at/</guid>
<description>&#60;p&#62;Saksoy, the &#60;em&#62;require&#60;/em&#62; statement tells your plugin to load the contents of a specific file when running another. &#60;em&#62;require_once&#60;/em&#62; ensures that a file ist loaded only once thus preventing an error.&#60;/p&#62;
&#60;p&#62;If all plugins, making use of class-phpmailer.php require the file which resides in the wp-includes path of the WordPress installation and do that by calling require_once, this file, holding the class phpmailer in fact is loaded only once when running any of these plugins.&#60;/p&#62;
&#60;p&#62;That's why BackUpWordPress requires the class-phpmailer that comes with WordPress.&#60;br /&#62;
Another method would be to ask if that class exists allready: &#60;a href=&#34;http://www.php.net/class_exists&#34; rel=&#34;nofollow&#34;&#62;http://www.php.net/class_exists&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;so the following code would have a similar effect:&#60;/p&#62;
&#60;p&#62;if (!class_exists(&#34;phpmailer&#34;)) {&#60;br /&#62;
   require_once(ABSPATH.&#34;wp-includes/class- phpmailer.php&#34;);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;Put this instead of the require-line in wp-email.php and you'll be fine.
&#60;/p&#62;</description>
</item>
<item>
<title>Saksoy on "[closed] Fatal error: Cannot redeclare class phpmailer"</title>
<link>http://wpforum.designpraxis.at/topic/fatal-error-cannot-redeclare-class-phpmailer#post-113</link>
<pubDate>Wed, 12 Sep 2007 14:53:44 +0000</pubDate>
<dc:creator>Saksoy</dc:creator>
<guid isPermaLink="false">113@http://wpforum.designpraxis.at/</guid>
<description>&#60;p&#62;Thanks, for the help.&#60;/p&#62;
&#60;p&#62;I changed the first half but I did not understand the following:&#60;/p&#62;
&#60;p&#62;you should also change the path to the file that comes with WordPress and use require_once instead of require.&#60;br /&#62;
use: require_once(ABSPATH.&#34;wp-includes/class- phpmailer.php&#34;);&#60;/p&#62;
&#60;p&#62;Can you clarify please? In which file do I change this?&#60;/p&#62;
&#60;p&#62;I will definitely mention this conflict and your fix to WP-Email.&#60;/p&#62;
&#60;p&#62;Thanks for you time and help.
&#60;/p&#62;</description>
</item>
<item>
<title>Saksoy on "[closed] Fatal error: Cannot redeclare class phpmailer"</title>
<link>http://wpforum.designpraxis.at/topic/fatal-error-cannot-redeclare-class-phpmailer#post-112</link>
<pubDate>Wed, 12 Sep 2007 14:52:02 +0000</pubDate>
<dc:creator>Saksoy</dc:creator>
<guid isPermaLink="false">112@http://wpforum.designpraxis.at/</guid>
<description>&#60;p&#62;I have the WP-EMail plugin installed and when I activate the BackupWordPress it interferes with it. This is the error message it gives when I try to click on the email this post link.&#60;/p&#62;
&#60;p&#62;Fatal error: Cannot redeclare class phpmailer in /homepages/30/d131350319/htdocs/wp-content/plugins/email/class-phpmailer.php on line 21&#60;/p&#62;
&#60;p&#62;For now I will just have to switch between the two to backup my site. Any ideas why?&#60;/p&#62;
&#60;p&#62;Great plugin, just wish the two would work simultaneously, so I can utilizes the automatic email backup.&#60;/p&#62;
&#60;p&#62;=================&#60;br /&#62;
Roland Rust replied&#60;br /&#62;
class-phpmailer.php is actually a class that comes with WordPress since version 2.2.0.&#60;br /&#62;
On line 24 of wp-email.php, which is the main file of the WP-Email plugin you can find the require statement for that class.&#60;/p&#62;
&#60;p&#62;Add the following if-statement around it:&#60;br /&#62;
if (class_exists('phpmailer')) {&#60;br /&#62;
 require(...);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;you should also change the path to the file that comes with WordPress and use require_once instead of require.&#60;br /&#62;
use: require_once(ABSPATH.&#34;wp-includes/class-phpmailer.php&#34;);
&#60;/p&#62;</description>
</item>

</channel>
</rss>

