We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Email Module - Not working and receiving emails

How Do I?

andrew.reff's avatar
andrew.reff
26 posts
8 years ago
andrew.reff's avatar andrew.reff

Hey everyone!

Trying to figure this bug out and it’s driving me crazy! I implemented a basic functionality of the “User Email Module” in a template, I think i did it right (easy right?), when I send an email thru my form, I get a proper reply & redirect;

-> Thank you Email has been sent

BUT this email will never arrive in my mailbox? I’ve tested the following;

Tools >> Communicate >> Send an Email = Works!

Here is the markup for the form;

<form id="contact_form" method="post" action="https://expressionengine.com/forums/new-topic/135/how-do-i"  >
<div class='hiddenFields'>
<input type="hidden" name="ACT" value="5" />
<input type="hidden" name="RET" value="forums/new-topic/135/how-do-i" />
<input type="hidden" name="URI" value="forums/new-topic/135/how-do-i" />
<input type="hidden" name="PRV" value="" />
<input type="hidden" name="recipients" value="T7UIFX0M3Gh/fhycNy8VUZr3Va1r3baP7qQM0TOaK+s=" />
<input type="hidden" name="user_recipients" value="XQL7xobWI7WB+Cm5YQ/sCTZAuCK6bxhBfc82z9vjX8s=" />
<input type="hidden" name="charset" value="" />
<input type="hidden" name="allow_attachments" value="sL+oATdf4xCGBKVzDCqbYUnK7a88KsZCoKni0L+C+BQ=" />
<input type="hidden" name="redirect" value="" />
<input type="hidden" name="replyto" value="" />
<input type="hidden" name="markdown" value="XQL7xobWI7WB+Cm5YQ/sCTZAuCK6bxhBfc82z9vjX8s=" />
<input type="hidden" name="site_id" value="5" />
<input type="hidden" name="csrf_token" value="a2153e0e5c9709cb8fb21d588e371febce1896a9" />
</div>


            <fieldset>
             <ul>
              <li class="subject">
               <label>
                <span class="formlabel"></span>
                <input type="hidden" class="formcontrol" id="subject" name="subject" value="A Message from DriveVelocity Contact Form" />
               </label>
              </li>
              <li class="name">
               <label>
                <span class="formlabel">Name</span>
                <input type="email" class="formcontrol" name="name" placeholder="Type your name">
               </label>
              </li>              
              <li class="email">
               <label>
                <span class="formlabel">Email Address</span>
                <input type="email" class="formcontrol" name="from" placeholder="[email protected]">
               </label>
              </li>
              <li class="company">
               <label>
                <span class="formlabel">Company</span>
                <input type="text" class="formcontrol" name="company" placeholder="Type your Company">
               </label>
              </li> 
              <li class="position">
               <label>
                <span class="formlabel">Position</span>
                <input type="text" class="formcontrol" name="position" placeholder="GM, IT Director">
               </label>
              </li>
              <li class="phone">
               <label>
                <span class="formlabel">Phone</span>
                <input type="tel" class="formcontrol" name="phone" placeholder="Type your number">
               </label>
              </li>           
              <li class="ext">
               <label>
                <span class="formlabel">Ext</span>
                <input type="text" class="formcontrol" name="ext" placeholder="ex 1234">
               </label>
              </li>           
              <li class="additional">
               <label>
                <span class="formlabel">Additional Notes</span>
                <textarea  type="text" class="formcontrol" name="message" rows="8" placeholder="Anything else you'd like us to know?"></textarea>
               </label>
              </li>                
              <li class="send">
               <label>
                <button class="button button-large" name="submit" type='submit' value="Send">Send <i class="fa fa-arrow-right" aria-hidden="true"></i></button>
               </label>
              </li>            
             </ul>
            </fieldset>               
           </form>

Any help is greatly appreciated! Thank you!

       
Neil Evans's avatar
Neil Evans
1,374 posts
8 years ago
Neil Evans's avatar Neil Evans

Hi Andy, I am guessing the email is setup to send via PHP Mail, rather than sending througha true SMTP mailbox? I am therefore guessing you are getting caught as SPAM.

If it is sending OK, then it suggests its the receiving side. Test with any real SMTP details and see if that solves it as first attempt.

N

       
andrew.reff's avatar
andrew.reff
26 posts
8 years ago
andrew.reff's avatar andrew.reff

@neil … actually have it set up to SMTP and SMTP server already … Everything I do inside of the CP works perfectly fine, everything else on the frontend doesn’t go anywhere. Going crazy over this 😛 Ha

       
Neil Evans's avatar
Neil Evans
1,374 posts
8 years ago
Neil Evans's avatar Neil Evans

Is the above what is rendered in your page? Or what you have in the template? I assume it has to be the rendered HTML otherwise having a fixed CSRF token would prevent the form from submitting, etc.!

Could you show the actual template code?

Also, the sent from and reply to address - what do you have that set to? I assume the same as the SMTP email you are sending from? Otherwise SPAM filters might be playing you up again!

       
andrew.reff's avatar
andrew.reff
26 posts
8 years ago
andrew.reff's avatar andrew.reff

@neil here is the code used in my template;

{exp:email:contact_form user_recipients="no" recipients="*I know this is where my email goes*" charset="utf-8"}
 <fieldset>
   <ul>
    <li class="subject">
     <label>
      <span class="formlabel"></span>
      <input type="hidden" class="formcontrol" id="subject" name="subject" value="A Message from DriveVelocity Contact Form" />
     </label>
    </li>
    <li class="name">
     <label>
      <span class="formlabel">Name</span>
      <input type="email" class="formcontrol" name="name" placeholder="Type your name">
     </label>
    </li>              
    <li class="email">
     <label>
      <span class="formlabel">Email Address</span>
      <input type="email" class="formcontrol" name="from" placeholder="[email protected]">
     </label>
    </li>
    <li class="company">
     <label>
      <span class="formlabel">Company</span>
      <input type="text" class="formcontrol" name="company" placeholder="Type your Company">
     </label>
    </li> 
    <li class="position">
     <label>
      <span class="formlabel">Position</span>
      <input type="text" class="formcontrol" name="position" placeholder="GM, IT Director">
     </label>
    </li>
    <li class="phone">
     <label>
      <span class="formlabel">Phone</span>
      <input type="tel" class="formcontrol" name="phone" placeholder="Type your number">
     </label>
    </li>           
    <li class="ext">
     <label>
      <span class="formlabel">Ext</span>
      <input type="text" class="formcontrol" name="ext" placeholder="ex 1234">
     </label>
    </li>           
    <li class="additional">
     <label>
      <span class="formlabel">Additional Notes</span>
      <textarea  type="text" class="formcontrol" name="message" rows="8" placeholder="Anything else you'd like us to know?"></textarea>
     </label>
    </li>                
    <li class="send">
     <label>
      <button class="button button-large" name="submit" type='submit' value="Send">Send <i class="fa fa-arrow-right" aria-hidden="true"></i></button>
     </label>
    </li>            
   </ul>
 </fieldset>               
{/exp:email:contact_form}
       
andrew.reff's avatar
andrew.reff
26 posts
8 years ago
andrew.reff's avatar andrew.reff

From my understanding I’m using everything I should be using from the syntax outlined here; https://docs.expressionengine.com/latest/add-ons/email/contact_form.html

       
Neil Evans's avatar
Neil Evans
1,374 posts
8 years ago
Neil Evans's avatar Neil Evans

On a latest EE3 environment - i cut and paste your code and it worked without a hitch. Except that the Name field is required to be an email!!! And that only a few fields are allowed - i am sure company, position, phone, ext, etc are being ignored!

The fact this works for me, and it sends you the confirmation saying it works for you suggests 99% that the email is sent. I still strongly believe it is being blocked by SPAM filters on the receiving side for various potential reasons.

1 - test with other emails addresses (from and arriving to)

2 - https://docs.expressionengine.com/latest/add-ons/email/contact_form.html#replyto I would suggest changing this so that it uses the webmasters email address, and make sure thatr matches the one you are using for the SMTP address.

I would then move on to suggest that it seems you want the form to be more than just name email and message. Therefore i personally would highly recommend using Solspaces FreeForm - in the free variety! https://solspace.com/expressionengine/freeform/

N

       
Rob Allen's avatar
Rob Allen
2,950 posts
8 years ago
Rob Allen's avatar Rob Allen

For the stock email form you need to use INPUT name attributes differently for additional fields over and above the generic ones - https://docs.expressionengine.com/latest/add-ons/email/contact_form.html#id11

Instead of

<input type="text" class="formcontrol" name="company" placeholder="Type your Company">

You need to use message[]

<input type="text" class="formcontrol" name="message[]" placeholder="Type your Company">

Then to get a field name in your email add a hidden field like this:

<input type="hidden" name="message[]" value="--Company name--">
<input type="text" class="formcontrol" name="message[]" placeholder="Type your Company">

In the email this will output something like:

–Company name–

ACME Ltd

So your form content should look something like this:

<fieldset>
   <ul>
    <li class="subject">
     <label>
      <span class="formlabel"></span>
      <input type="hidden" class="formcontrol" id="subject" name="subject" value="A Message from DriveVelocity Contact Form" />
     </label>
    </li>
    <li class="name">
     <label>
      <span class="formlabel">Name</span>
      <input type="email" class="formcontrol" name="name" placeholder="Type your name">
     </label>
    </li>              
    <li class="email">
     <label>
      <span class="formlabel">Email Address</span>
      <input type="email" class="formcontrol" name="from" placeholder="[email protected]">
     </label>
    </li>
    <li class="company">
     <label>
      <span class="formlabel">Company</span>
      <input type="hidden" name="message[]" value="--company-">
      <input type="text" class="formcontrol" name="message[]" placeholder="Type your Company">
     </label>
    </li> 
    <li class="position">
     <label>
      <span class="formlabel">Position</span>
      <input type="hidden" name="message[]" value="--position--">
      <input type="text" class="formcontrol" name="message[]" placeholder="GM, IT Director">
     </label>
    </li>
    <li class="phone">
     <label>
      <span class="formlabel">Phone</span>
      <input type="hidden" name="message[]" value="--phone--">
      <input type="tel" class="formcontrol" name="message[]" placeholder="Type your number">
     </label>
    </li>           
    <li class="ext">
     <label>
      <span class="formlabel">Ext</span>
      <input type="hidden" name="message[]" value="--ext--">
      <input type="text" class="formcontrol" name="message[]" placeholder="ex 1234">
     </label>
    </li>           
    <li class="additional">
     <label>
      <span class="formlabel">Additional Notes</span>
      <input type="hidden" name="message[]" value="--notes--">
      <textarea type="text" class="formcontrol" name="message[]" rows="8" placeholder="Anything else you'd like us to know?"></textarea>
     </label>
    </li>                
    <li class="send">
     <label>
      <button class="button button-large" name="submit" type='submit' value="Send">Send <i class="fa fa-arrow-right" aria-hidden="true"></i></button>
     </label>
    </li>            
   </ul>
 </fieldset>
       
andrew.reff's avatar
andrew.reff
26 posts
8 years ago
andrew.reff's avatar andrew.reff

@rob … this is exact code I am using for my form, per your prior message … Am I missing something here because I am still not getting message to go through.

My form opening and closing tags are;

“{exp✉️contact_form user_recipients="no" recipients="andy@emailaddress" charset="utf-8" redirect="none" return="{site_url}”}” & “{/exp✉️contact_form}”

<fieldset>
   <ul>
    <li class="subject">
     <label>
      <span class="formlabel"></span>
      <input type="hidden" class="formcontrol" id="subject" name="subject" value="A Message from DriveVelocity Contact Form" />
     </label>
    </li>
    <li class="name">
     <label>
      <span class="formlabel">Name</span>
      <input type="text" class="formcontrol" name="name" placeholder="Type your name">
     </label>
    </li>              
    <li class="email">
     <label>
      <span class="formlabel">Email Address</span>
      <input type="email" class="formcontrol" name="from" placeholder="[email protected]">
     </label>
    </li>
    <li class="company">
     <label>
      <span class="formlabel">Company</span>
      <input type="hidden" name="message[]" value="--company-">
      <input type="text" class="formcontrol" name="message[]" placeholder="Type your Company">
     </label>
    </li> 
    <li class="position">
     <label>
      <span class="formlabel">Position</span>
      <input type="hidden" name="message[]" value="--position--">
      <input type="text" class="formcontrol" name="message[]" placeholder="GM, IT Director">
     </label>
    </li>
    <li class="phone">
     <label>
      <span class="formlabel">Phone</span>
      <input type="hidden" name="message[]" value="--phone--">
      <input type="tel" class="formcontrol" name="message[]" placeholder="Type your number">
     </label>
    </li>           
    <li class="ext">
     <label>
      <span class="formlabel">Ext</span>
      <input type="hidden" name="message[]" value="--ext--">
      <input type="text" class="formcontrol" name="message[]" placeholder="ex 1234">
     </label>
    </li>           
    <li class="additional">
     <label>
      <span class="formlabel">Additional Notes</span>
      <input type="hidden" name="message[]" value="--notes--">
      <textarea type="text" class="formcontrol" name="message[]" rows="8" placeholder="Anything else you'd like us to know?"></textarea>
     </label>
    </li>                
    <li class="send">
     <label>
      <button class="button button-large" name="submit" type='submit' value="Send">Send <i class="fa fa-arrow-right" aria-hidden="true"></i></button>
     </label>
    </li>            
   </ul>
 </fieldset>

Thanks in advance!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.