Prolateral Consulting Ltd
Prolateral Consulting Ltd
Support
Support
Knowledgebase Articles
Help
Setup examples
Support

Prolateral offers primary and backup domain (DNS) services, with servers in key geographic locations providing the best service possible.

Problem

How do I set up outbound SMTP using CakePHP?
How do I set up outbound SMTP using the email component from CakePHP?
How do I use outMail in CakePHP?
How do I use outMail with the email component from CakePHP?

Solution

The following example of code assumes you have already got a fully functional webserver and the CakePHP framework installed and working.

Example code outmail-cakephp.php


<?php

	public $default = array(
	    'host' => 'mxXXXXXX.smtp-engine.com',
	    'port' => 25,
	    'auth' => 'plain',
	    'username' => 'outmail_username',
	    'password' => '**********',
	    'tsl' => false,
	    'transport' => 'smtp',
	    'from' => array('me@example.com' => 'Username'),
	    'returnPath' => 'me@example.com',
	    'layout' => false,
	    'emailFormat' => 'html',
	    'template' => 'only_text',
	    'charset' => 'utf-8',
	    'headerCharset' => 'utf-8',
	);

	$this->Email->to = 'Name <toaddress@example.com>';
	$this->Email->subject = 'Subject goes here...';
	$this->Email->from = 'My Name <me@xample.com>';
	$this->Email->template = 'user_confirm';
	$this->Email->sendAs = 'html';
	$this->Email->smtpOptions = $default;
	$this->Email->delivery = 'smtp';

	if ($this->Email->send()) {
		return true;
	} else {
		echo $this->Email->smtpError;
	}
   
?>

Summary of server details

Outgoing server

mxXXXXXX.smtp-engine.com

As provided in your signup email.

Outgoing server protocol

SMTP

Outgoing server port

25, 465, 587, 2525 or 8025

Authentication Type

Basic Authentication, SSL and TLS supported

Username

As provided

Password

As provided

 

like it, love it, then share it. Share this article on social media.

Did you enjoy this article?

Disclaimer

The Origin of this information may be internal or external to Prolateral Consulting Ltd. Prolateral makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Prolateral makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.