Jump to:

1999 Posts in 1421 Topics by 613 members

Form Questions

SilverStripe Forums » Form Questions » User Defined Form stopped sending emails

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

Page: 1
Go to End
Author Topic: 1356 Views
  • filip667
    Avatar
    Community Member
    10 Posts

    User Defined Form stopped sending emails Link to this post

    hello there!

    i installed the UserDefinedForm (cheers Willr btw!), everything was working perfectly fine, sending emails to different email addresses from the drop down menu etc.

    problems started when i created another UserDefinedForm within the same website. both Forms just stopped sending email eventhough the messages still appear in the Submnission tab in CMS.

    i tried all the following sollutions but they didnt work:
    - i checked in Spam and it's definatelly not there.
    - i deleted both contact pages and created them from scratch.

    (i've noticed that each new User Defined Form Email Recipient has got different number when saving, for example #9. shall i change this number somwhere else or kind of reset it?)

    - i tried to build the new UserDefinedForm in different fresh version of SS linked to old database. still emails are not sent.
    - i installed new fresh version of SS with new database - still no emails, submission tab fine.
    - no need to mention i ran dev/build and ?flush=1 as well.

    pls anybody help, i tried all the related topics on the forum. no luck

  • Willr
    Avatar
    Forum Moderator
    5483 Posts

    Re: User Defined Form stopped sending emails Link to this post

    Make sure your email recipient has valid 'From' fields as well as 'To' Field. Lots of hosts will block email not sent from a valid domain on the server.

    If you have access to them the mail logs are a good place to start. You could also attempt to send a email using the standard php mail() tag (just create a little function which uses mail http://php.net/manual/en/function.mail.php) and check that you receive email sent using that.

  • filip667
    Avatar
    Community Member
    10 Posts

    Re: User Defined Form stopped sending emails Link to this post

    thanks for the answer Willr! both "From/To" fields are correct, using two different working email addresses. the "From" field picks up the value from the "email field" on the Contact page. the "Send email to" is with my valid email address.

    also the web hosting team just check the server logs and said that it looked like my application did not send emails at all!

    what baffles me is that before it worked perfectly fine! even when i put in the "From" field some made up invalid email addresses. the "Send email to" field used to be a drop down menu with a few different email addresses. when i tested it on various computers, all recipients received emails. it stopped working when i added another UserDefinedForm to the website. i think it may have got something to do with the database, as every new Form i create assigns new User Defined Form Email Recipient number: #1, #2, #3 etc.

    attached print screen if that helps.

    unfortunatelly my PHP is not that fluent to create the sophisticated formula function unless there's available some ready made piece of code to be pasted into appropiate place...

    Attached Files
  • Willr
    Avatar
    Forum Moderator
    5483 Posts

    Re: User Defined Form stopped sending emails Link to this post

    I simple mail test is a function like this on your Page_Controller

    function sendmail() {
    mail('youremail@email.com', 'test', 'test message');
    }

    Then visit yoursite.com/home/sendmail and you should get an email. If you don't then something wrong with your php mail configuration or if you do get an email then somethings wrong with the userforms configuration in the backend.

  • filip667
    Avatar
    Community Member
    10 Posts

    Re: User Defined Form stopped sending emails Link to this post

    cheers buddy!

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