Every Damn Morning by xkcd
If you cannot send mail through B2evo, probably because your host has disabled PHP's mail() function you must use another mailserver. There are other situations where you deliberately want to use this.
This solution will work with any SMTP server you have access to (can authenticate through username/password).
I had a successful go with Swift mailer in B2evo 1.10.3 and in 2.4.0 rc2. This is how to set it up:
1) Download swift-smtp from http://www.swiftmailer.org/download/ . Unpack and upload the /lib/ folder. I made a directory in /inc/_misc/ called swift-smtp where I put the lib folder. So this looks like /inc/_misc/swift-smtp/lib/. Feel free to add the folder to /htsrv/ where I think it belongs.
2) Open /inc/_misc/_misc.funcs.php and replace lines 2348 - 2362. If you are using B2evo v2.4.0 rc 2 look for this codesnippet in inc/misc/_misc.funcs.php line ~1568.:
if( $debug > 1 )
{ // We agree to die for debugging...
if( ! mail( $to, $subject, $message, $headerstring ) )
{
debug_die( 'Sending mail from
«'.htmlspecialchars($from).'» to
«'.htmlspecialchars($to).'», Subject
«'.htmlspecialchars($subject).'» FAILED.' );
}
}
else
{ // Soft debugging only....
if( ! @mail( $to, $subject, $message, $headerstring ) )
{
$Debuglog->add( 'Sending mail from
«'.htmlspecialchars($from).'» to
«'.htmlspecialchars($to).'», Subject
«'.htmlspecialchars($subject).'» FAILED.', 'error' );
return false;
}
}
by:
//setup swift-smtp
require_once( dirname(__FILE__).'/swift-smtp/lib/Swift.php' );
require_once( dirname(__FILE__).'/swift-smtp/lib/Swift/Connection/SMTP.php' );
global $smtp_server, $smtp_user, $smtp_password, $smtp_port;
$smtp =& new Swift_Connection_SMTP( $smtp_server, $smtp_port);
$smtp->setUsername( $smtp_user );
$smtp->setpassword( $smtp_password );
$swift =& new Swift($smtp);
$mail =& new Swift_Message( $subject, $message);
$to_name = preg_replace( '/^.*?<(.+?)>$/', '$0', $to );
$from_name = preg_replace( '/^.*?<(.+?)>$/', '$0', $from );
$to_email = preg_replace( '/^.*?<(.+?)>$/', '$1', $to );
$from_email = preg_replace( '/^.*?<(.+?)>$/', '$1', $from );
$new_to = new Swift_Address( $to_email, $to_name );
$new_from = new Swift_Address( $from_email, $from_name );
if( $debug > 1 )
{ // We agree to die for debugging...
if( ! $swift->send( $mail, $new_to, $new_from ))
{
debug_die( 'Sending mail from
«'.htmlspecialchars($from).'» to
«'.htmlspecialchars($to).'», Subject
«'.htmlspecialchars($subject).'» FAILED.' );
}
}
else
{ // Soft debugging only....
if( ! @$swift->send( $mail, $new_to, $new_from ))
{
$Debuglog->add( 'Sending mail from
«'.htmlspecialchars($from).'» to
«'.htmlspecialchars($to).'», Subject
«'.htmlspecialchars($subject).'» FAILED.', 'error' );
return false;
}
}
I prefer the variables in /conf/_advanced.php. Somewhere put this block:
/**
* SMTP
* uses swift-smtp
*/
$smtp_server = 'smtp.server.tld';
$smtp_port = 25;
$smtp_user = 'user';
$smtp_password = 'password';
If you want to put the Swift mailer files in the /htsrv/ folder (/htsrv/swift-smtp/lib/) you change these lines of the code:
require_once( dirname(dirname(dirname(__FILE__))).'/htsrv/swift-smtp/lib/Swift.php' );
require_once( dirname(dirname(dirname(__FILE__))).'/htsrv/swift-smtp/lib/Swift/Connection/SMTP.php' );
Once again: I took the /lib/ folder from the package and put it in a custom made /swift-smtp/ folder. You may copy the /lib/ folder from swift-smtp directly to the /htsrv/ folder, but change the path accordingly.
Thanks to dcihon for testing.
Good luck
Ljubojevic, Ljubomir - Andersson, Ulf, Hoogovens, Wijk aan Zee NED, 1976
1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 Qc7 6. Be2 a6 7. O-O Nf6 8.Be3 Be7 9. f4 d6 10. Qe1 O-O 11. Qg3 Bd7




































































































12. e5 dxe5 13. fxe5 Nxe5 14. Bf4 Bd6 15. Rad1 Qb8 16. Rd3 Ne8 17. Ne4 Bc7 18. Rc3 Nc6 19. Bxc7 Nxd4 20.Bd3 Qa7 21. Nc5 Bb5 22. Be5 Nc6 23. Bxh7+ Kxh7 24. Rf4 f6 25. Rh4+ Kg8 26. Qh3 Nd8 27. Bd4 b6 28. Nxe6 Nxe6 29. Qxe6+ Qf7 30. Qe4 g5 31. Rh6 Ra7 32. Rch3 Qg7 33. Rg6 Rff7 34. c4 1-0
I made a plugin to display a random image from a folder in the sidebar. Due to lack of imagination it is called the Random Picture plugin. Actually it is a widget, or a plugin for a widget with a widget in it, or something like that.
The plugin takes the folder /plugins/randompic_plugin/images/ and is able to determine which files are in the folder. It then randomly takes one and displays it in a widget container.
You can put as many pictures in the folder as you like.
The plugin takes the folder /plugins/randompic_plugin/images/ and is able to determine what files are in the folder. It then randomly takes one and displays it in a widget container.
What to do?
Changelog
0.4 Version 0.4 is a maintenance update after
video:metcafe:1041454/dolphin_play_bubble_rings.swf
[video:metcafe:1041454/dolphin_play_bubble_rings.swf]
Thanks to: http://www.alistapart.com/articles/byebyeembed
<embed src="http://www.metacafe.com/fplayer/1041454/dolphin_play_bubble_rings.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed><br /><font size="1">
<a href="http://www.metacafe.com/watch/1041454/dolphin_play_bubble_rings/"> Dolphin Play Bubble Rings - video powered by Metacafe</a></font>
<object type="application/x-shockwave-flash"
data="http://www.metacafe.com/fplayer/1041454/dolphin_play_bubble_rings.swf"
width="400" height="335" id="VideoPlayback">
<param name="movie"
value="http://www.metacafe.com/fplayer/1041454/dolphin_play_bubble_rings.swf" />
<param name="allowScriptAcess" value="sameDomain" />
<param name="quality" value="best" />
<param name="bgcolor" value="#FFFFFF" />
<param name="scale" value="noScale" />
<param name="salign" value="TL" />
<param name="FlashVars" value="playerMode=embedded" />
</object>