Coldbox Mail Service Error

I’m getting “The method getPlugin was not found in component D:\coldbox\system\mvc\Controller.cfc.” when I run below code to send email


mailSettings = {
server = “XXXX”,
username = “XXX”,
password = “XXX”,
port = 587

// get ColdBox to inject the MailService plugin for us
property name=“MailService” inject=“coldbox:plugin:MailService”;

void function send( required event )
//var rc = arguments.event.getCollection();

var Email = variables.MailService.newMail();
Email.setTo( “” );
Email.setFrom( “Test” );

Email.setType( “html” );
Email.setSubject( “Test Email” );
Email.setBody( “

Test email MailService

” );
temp = variables.MailService.send( Email );
// set thanks message
//rc.message = “Thank you for your comment”;

// set the view to show
//arguments.event.setView( “thanks” );


Do I need to add any other settings to resolve this. Thanks

Hi Rakesh,

If you are using coldbox-3.8.1 version then your syntax is correct, try to have another name for your handler “Mailer” instead MailService.

Plugin Docs

Also you can download coldbox-3.8.1 from

Are you using ColdBox Lite? It does not include plugins. You need to use the full ColdBox platform if you want the goodies.

I would also recommend you upgrade to ColdBox 4.0 as the mail services have been turned into an optional module.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform: