We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42967
    • 143 Posts
    My formit emails keep ending up in my clients junk folder, are there any measures I can take to avoid this?

    thanks,
    Gareth
      Eighth day design
      Design agency with offices in Edinburgh and Brighton
      • 37110
      • 72 Posts
      Hello Gareth,

      Could you show me your FormIt call?
      I think you forgot the reply-to setting.
        • 42967
        • 143 Posts
        	
        
        It's a little unusual as I am using simpleCart:  
        
        [[!FormIt?
        &store=`1`
        &hooks=`spam,scCreateOrder,redirect`
        &submitVar=`checkout`
        &redirectTo=`[[*id:scFirstChild]]`
        &orderAddress=`address1:number,address2:street,address3:county`    &deliverAddress=`firstname:del_firstname,lastname:del_lastname,address1:del_number,address3:del_county,address2:del_street,zip:del_zip,city:del_city,country:del_country,email:del_email,phone:del_phone`
        ]]
          Eighth day design
          Design agency with offices in Edinburgh and Brighton
          • 37110
          • 72 Posts
          This FormIt call is not sending any mail.
          You have to specify your settings at the finish page with the scFinishOrder snippet.

          The file that sends the mail is located /core/components/simplecart/hooks/order/finish.php
            • 42967
            • 143 Posts
            brillant thank you! I guess I need to specify a from email address and maybe change the sender to my clients email address?

            // get the mail service
            	$modx->getService('mail', 'mail.modPHPMailer');
            	$modx->mail->set(modMail::MAIL_BODY, $output);
            	$modx->mail->set(modMail::MAIL_FROM, (!empty($emailFrom) ? $emailFrom : $modx->getOption('emailsender')));
            	$modx->mail->set(modMail::MAIL_FROM_NAME, (!empty($emailFromName) ? $emailFromName : $modx->getOption('site_name')));
            	$modx->mail->set(modMail::MAIL_SENDER, (!empty($emailFrom) ? $emailFrom : $modx->getOption('emailsender')));
            	$modx->mail->set(modMail::MAIL_SUBJECT, $emailSubject);
            	$modx->mail->address('to', $orderAddress->get('email'), $fullname);
            	$modx->mail->address('reply-to', (!empty($emailFrom) ? $emailFrom : $modx->getOption('emailsender')));
            	$modx->mail->setHTML($modx->getOption('emailHTML', $scriptProperties, true));
              Eighth day design
              Design agency with offices in Edinburgh and Brighton
              • 37110
              • 72 Posts
              As you could see the default options are the emailsender and the sitename system settings.
              I think you already specified these settings..

              Did you checked your server ip address on blacklists?
              Did you did a test order and looked at the email headers?

              Is there a pattern for witch clients the emails ending up inside the junk folder? Domain (gmail, hotmail, etc.. )
                • 42967
                • 143 Posts
                thank you for the tips.

                The MAIL_SENDER is set to the customers email address, I think changing this the stores email address should help.
                  Eighth day design
                  Design agency with offices in Edinburgh and Brighton
                  • 37110
                  • 72 Posts
                  That should fix the problem i hope.