Problems about Contact form 7 wordpress [closed]

0

I wanted to tell you a question or a problem that I have, to see if you can help me, I have a wordpress with the famous contact form 7 to create forms, right now I have validated the forms that I need correctly and I can not detect any error , but when I fill in the fields and I send it, he complains that he can not send the mail, my question is or doubt, I need to configure something specific within the wordpress to be able to send messages without the need of a plugin to control mails, type easy mail smtp or some like that, because with them I can not solve anything either ..., thanks! = D by the way, the version of the wordpress is the last one (the 4.9.8) that has come out, and I have tried to deactivate all the plugins and themes to see if that, nothing ... I use a theme purchased in themeforest. .. = D

    
asked by KevSolid 18.10.2018 в 16:58
source

1 answer

0

To work with CF7 you need to do the following process:

  • Create an email account within the server by [email protected]
  • Configure CF7 with this created account, which physically exist within the server.
  • If, when performing these 2 steps, it still does not work, verify that your server is sending emails correctly, you can do it with the following code:
  • * You create an email.php file in the root of your server and access it from the browser sitio.com/email.php if it generates "Mail sent OK" everything goes well with the mail service.

    <?php
    /*
    From http://www.html-form-guide.com 
    This is the simplest emailer one can have in PHP.
    If this does not work, then the PHP email configuration is bad!
    */
    $msg="";
    if(isset($_POST['submit']))
    {
        /* ****Important!****
        replace [email protected] below 
        with an email address that belongs to 
        the website where the script is uploaded.
        For example, if you are uploading this script to
        www.my-web-site.com, then an email like
        [email protected] is good.
        */
    
        $from_add = "[email protected]"; 
    
        $to_add = "[email protected]"; //<-- put your yahoo/gmail email address here
    
        $subject = "Test Subject";
        $message = "Test Message";
    
        $headers = "From: $from_add \r\n";
        $headers .= "Reply-To: $from_add \r\n";
        $headers .= "Return-Path: $from_add\r\n";
        $headers .= "X-Mailer: PHP \r\n";
    
    
        if(mail($to_add,$subject,$message,$headers)) 
        {
            $msg = "Mail sent OK";
        } 
        else 
        {
           $msg = "Error sending email!";
        }
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
    <html>
    <head>
        <title>Test form to email</title>
    </head>
    
    <body>
    <?php echo $msg ?>
    <p>
    <form action='<?php echo htmlentities($_SERVER['PHP_SELF']); ?>' method='post'>
    <input type='submit' name='submit' value='Submit'>
    </form>
    </p>
    
    
    </body>
    </html>
    
  • If it still does not work, you should configure an SMTP plugin link so that the emails are authenticated from your server to any mail service and do not have problems sending mails.
  • Support the official plugin documentation: link

        
    answered by 30.10.2018 / 06:53
    source