Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Email not sending in live environment with Email_Template class

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1248 Views
  • Wows
    Avatar
    Community Member
    4 Posts

    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????

    1248 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.