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.

All other Modules /

Discuss all other Modules here.

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

Can PHP mail but silverstripe userforms will not mail


Go to End


4 Posts   2186 Views

Avatar
Sullivanindy

Community Member, 7 Posts

26 June 2010 at 12:21am

Edited: 26/06/2010 12:25am

Can php mail() and send mail from bash Shell

But userforms will not mail.

Where can I start to troubleshoot this?

2.4.0

Avatar
Willr

Forum Moderator, 5523 Posts

26 June 2010 at 1:06pm

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.

Avatar
Sullivanindy

Community Member, 7 Posts

29 June 2010 at 2:44am

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-

Avatar
Sullivanindy

Community Member, 7 Posts

29 June 2010 at 3:29am

Edited: 29/06/2010 8:52am

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