Remember me? forgot password | register

SilverStripe Forum

10688 Posts in 2795 Topics by 1518 members

Jump to:

Site Builders

If this is your first visit, you will need to register before you can post. However, you can browse all messages below.

Community » SilverStripe Forum » Site Builders » Email not sending in live environment with Email_Template class
Page: 1 go to end Reply
Author Topic: Email not sending in live environment with Email_Template class 275 views
  • Wows
    Wows's avatar
    Community Member
    2 posts
    1 SilverStripe Site

    Email not sending in live environment with Email_Template class Link to this post

    Hi,

    The contact form I've setup works fine in my local environment, but once I've deployed it to live, it doesn't send an email - there are no errors it displays and everything appears to work, but no email is sent.

    Immediately I thought it was the SMTP configuration, and after checking that and testing sending emails another way, I'm really puzzled.

    If I send an email using the standard email class like this:
    $e = new Email('blah@blah.com', 'blah@blah.com', 'subject', 'message');
    $e->send();

    It works ok, but when I used the Email_Template class to send an email with a template file and data values - nothing happens:
    $email = new Email_Template();
    $email->ss_template = 'ContactUsEmail';
    $email->populateTemplate($fields);
    $email->subject = 'Subject';
    $email->from = 'blah@blah.com';
    $email->to = 'blah@blah.com';
    $email->send();

    Now this all works fine in my local environment. Both local and live have PHP v 5.1.4 installed. Any ideas what the problem could be????

    275 views
go to top Reply

Currently Online:

Fuzz10, LeeUmm, micahsheets, simon_w, motoservo

Welcome to our latest member: lorem