Doc2Form emails not working? Options
azzlack
Posted: Monday, April 14, 2008 9:49:10 AM

Rank: Devotee

Joined: 8/5/2007
Posts: 59
Location: Bergen, Norway
This is continuation of this topic:

I have tried to get this to work, but to no avail.

I get the notifications from Umbraco, but when I try to send a mail using Doc2Form, it doesn't work.

Here is how my template looks like:
Code:
<?ASPNET_FORM>
<?UMBRACO_MACRO macroAlias="Doc2FormEmail" DocumentType="1243" TabName="" PageTabs="0" HideTabNames="0" ShowDescriptions="0" RequiredText="" SubmitButtonText="Send" PreviousButtonText="" NextButtonText="" TextOnSubmit="" RedirectToNode="" StorePropertiesInCookies="" SendEmailResponse="0" ResponseSubject="" ResponseMessage="" ResponseEmailFieldAlias=", " ResponseCopyTo="" EmailForm="1" FormSubject="[#name] has sent you an email from www.eyecatch.no" FormMessage="[#message]" FormToEmailAddress="postmaster@eyecatch.no" FormFromEmailAddress="[#email]" UseAjax="0" DefaultValueNode=""></?UMBRACO_MACRO>
</?ASPNET_FORM>


Anyone knows how to set it up correctly?

www.eyecatch.no
drobar
Posted: Monday, April 14, 2008 2:58:48 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,285
Location: KY, USA
What you've got there looks good. There are a couple things to check and try that will hopefully isolate the problem.

First, temporarily change the FormSubject, FormMessage, and FormFromEmailAddress to specific values rather than fields. This will eliminate the possibility of odd characters or other non-obvious problems. Perhaps settings like:
FormSubject="Testing Doc2Form"
FormMessage="This is a test"
FormFromEmailAddress="info@eyecatch.no"

An important thing to notice is that the FormFromEmailAddress is in the same domain as the FormToEmailAddress which will avoid any problems caused by sending emails outside of your domain that might be considered "relaying" by your email server.

If these simplified settings work then the problem is simply in the macro's parameter configuration and should be easy to resolve.

If emails still don't get sent, look in the EventViewer or other logging application on your email server for error messages that will help pinpoint the problem.

Let us know what you find out.

cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
azzlack
Posted: Tuesday, April 15, 2008 1:28:12 PM

Rank: Devotee

Joined: 8/5/2007
Posts: 59
Location: Bergen, Norway
What do you know!

It works!

Removing the [#email] and setting it to a hard-coded value made it work.
But the email message was only "[#message]".

So it looks like it does not get the values from the form. The smtp server is probably rejecting it because [#email] is not a valid email address.

But what can I do to make it use the form fields?

This is how the document type looks like:


www.eyecatch.no
drobar
Posted: Tuesday, April 15, 2008 3:13:41 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,285
Location: KY, USA
Just use square brackets around the document property alias.

[name]
[email]
[message]

cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
azzlack
Posted: Wednesday, April 16, 2008 12:36:42 PM

Rank: Devotee

Joined: 8/5/2007
Posts: 59
Location: Bergen, Norway
Sweet! It's working flawlessly!

You're my hero, Douglas!

Thank you so much! Applause

www.eyecatch.no
mcyankee
Posted: Friday, June 27, 2008 5:13:56 AM
Rank: Newbie

Joined: 6/27/2008
Posts: 1
Location: Rosario, Argentina
Hello,
I'm kinda new to Umbraco... I had the same exact issue as azzlack, and I solved MOST of it by just removing the "#" inside the brackets.

The main idea of this contact form is that you select a subject, and depending on the selected subject your message is sent to a different email address. And, ideally emails shall have as FROM the user's email address.



So, the thing is I found out that under FormToEmailAddress and FormFromEmailAddress, you Can Not put something like this:
FormToEmailAddress="[emailTo]"
FormFromEmailAddress="[emailFrom]"



Here's my data tab:
nombre = textstring
subject = <new data type, derived from droplist>
emailFrom = textsting
telefono = textstring
comments = textbox multiple
emailTo = textstring


Here's my macro call:
<?UMBRACO_MACRO
macroAlias="Doc2FormEmail"
DictRequired="#doc2form_fieldisrequired"
DictInvalid="#doc2form_fieldisinvalid"
DocumentType="1186"
TabName="data"
PageTabs="true"
HideTabNames="true"
ShowDescriptions="true"
RequiredText=""
SubmitButtonText="Enviar"
PreviousButtonText=""
NextButtonText=""
TextOnSubmit=""
RedirectToNode="1511"
StorePropertiesCookie="false"
SendEmailResponse="0"
ResponseSubject=""
ResponseMessage=""
ResponseEmailFieldAlias=""
ResponseCopyTo=""
EmailForm="1"
FormToEmailAddress="[emailTo]"
FormFromEmailAddress="[emailFrom]"
FormSubject="Form Online - [subject]"
FormMessage="Nombre: [nombre]&lt;Br&gt;Email: [emailFrom]&lt;br&gt;Teléfono: [telefono] &lt;BR&gt;&lt;br&gt;Comentario:&lt;br&gt; [comments]"
></?UMBRACO_MACRO>


As I said, the only two places that are no replacements being made are in:
FormToEmailAddress="[emailTo]"
FormFromEmailAddress="[emailFrom]"


If I include both elements inside the message, and I set both FormToEmailAddress and FormFromEmailAddress to static values, then it works ok. And, I can see inside the message body the right values for emailFrom and emailTo.

I already tried with:
FormToEmailAddress="[#emailTo]" and FormFromEmailAddress="[#emailFrom]"
FormToEmailAddress="[@emailTo]" and FormFromEmailAddress="[@emailFrom]"
FormToEmailAddress="[$emailTo]" and FormFromEmailAddress="[$emailFrom]"



Any kind of ideas are greatly appreciated!

Thanks,
Andrew







Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.