Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Can PHP mail but silverstripe userforms will not mail

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1411 Views
  • Sullivanindy
    Avatar
    Community Member
    7 Posts

    Can PHP mail but silverstripe userforms will not mail Link to this post

    Can php mail() and send mail from bash Shell

    But userforms will not mail.

    Where can I start to troubleshoot this?

    2.4.0

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Can PHP mail but silverstripe userforms will not mail Link to this post

    UserForms uses the built in silverstripe Email class. You could setup a quick test using SilverStripe mail. If this works then its something in the module (like a configuration)

    // mysite/code/Page.php

    function TestEmail() {

    $mail = new Email('from@domain.com', 'email@domain.com', "test", "test");

    return $mail->send();
    }

    Then include $TestEmail in your template.

    Also check that you have a defined 'from' and 'to' address in your UserForms email tab. Some servers also require you to use a from address from a domain on the server.

  • Sullivanindy
    Avatar
    Community Member
    7 Posts

    Re: Can PHP mail but silverstripe userforms will not mail Link to this post

    Will,

    Thanks for the troubleshooting direction.. That code worked flawlessly and sent an email when i visted the page.. I double checked the from and to and used the same from i used in that test and still nothing from userforms..

    Mark-

  • Sullivanindy
    Avatar
    Community Member
    7 Posts

    Re: Can PHP mail but silverstripe userforms will not mail Link to this post

    Arrrghhhh.. Hey man, sorry, just forget about this post.. been working too much i guess..

    There is nothing wrong with the userforms module.. it was user idiot error..

    although I had a to: address in the settings I inadvertently must have checked the: or use a field for the form, and had something random selected in there.. amazing how something so simple is not evident when you stare at it for too long..

    Sorry to waste your time..;D

    1411 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.