Swift_Connection_NativeMail

Synopsis: new Swift_Connection_NativeMail( void )

This is probably the simplest of all the connections to get to grips with. It uses PHP's mail() function. It takes no constructor parameters and requires no configuration.

NOTE: Due to differences between mail() in Windows and mail() on UNIX-like systems there will be small inconsistencies between running this connection on Windows and Linux/OS X. These are perfectly fine.

NOTE2: If you use this connection you will not be able to run custom SMTP commands, for obvious reasons ;)

require_once "lib/Swift.php";
require_once "lib/Swift/Connection/NativeMail.php";
 
$swift =& new Swift(new Swift_Connection_NativeMail());

As of version 3.2.5, you can specify what the 5th parameter of mail() is structured like by passing it to the constructor. By default this is ā€-oi -f %sā€ where %s is replaced with the actual sender address using sprintf(). You can specify your own string by doing this for example.

require_once "lib/Swift.php";
require_once "lib/Swift/Connection/NativeMail.php";
 
$swift =& new Swift(new Swift_Connection_NativeMail("-f%s"));

NOTE: The above will only have any affect if safe_mode is turned off in php.ini.

 
v3/connections/nativemail.txt · Last modified: 2009/03/03 06:41 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki