Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

mail() function SMTP authentication


Go to End


2 Posts   1087 Views

Avatar
Mauro74

Community Member, 30 Posts

21 September 2011 at 11:29pm

Hi All,
My hosting provider (webhosting.uk.com) for security reason has disabled the PHP mail() function requiring to update our code using a SMTP authentication. I have no idea how to change the code, I suppose is in the sapphire folder? At the moment the contact form on my website doesn't send the email to the recipient and the newsletter module fails to send... Can anyone help me in this, or point me in the right direction?
Thanks in advance

Avatar
MarcusDalgren

Community Member, 288 Posts

22 September 2011 at 12:29am

You have to extend the Mailer class and make your own implementation.
When you've made your own implementation you put

$mailer = new My_Mailer();
Email::set_mailer($mailer);

in your _config.php and off you go. Have a look at the Mailer class for what you need to implement in your extension.