1. Go to this page and download the library: Download germania-kg/mailer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
germania-kg / mailer example snippets
use Germania\Mailer\MailerServiceProvider;
$dic = new \Pimple\Container;
$dic->register( new MailerServiceProvider );
$dic->register( new MailerServiceProvider );
$config = $dic['Mailer.Config'];
print_r($config);
use Germania\SwiftMailerCallable\SwiftMailerCallable;
// Grab the Mailer callable
$mailer = $dic[SwiftMailerCallable::class];
// DEPRECATED service name:
$mailer = $dic['Mailer.Callable'];
// Send with subject and mail body
$result = $mailer("The subject", "<p>The mailtext</p>");
# Override receipient address
# previosuly set in Mailer.Config
$result = $mailer("The subject", "<p>The mailtext</p>", "[email protected]");
use Germania\Mailer\SwiftMessageFactory;
use \Swift_Mailer;
// Grab Swiftmailer
$swift_mailer = $dic[Swift_Mailer::class];
// Setup message
$message_factory = $dic[SwiftMessageFactory::class];
$message = $message_factory->createMessage();
$message->setBody("This is the mail body");
// This optional as we set it with Configuration
$message->setSubject( "Custom subject line" );
// Send message
$result = $swift_mailer->send( $message ));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.