NogDog I missed it as I copied in the fake email address for the post. I´ts all there in the original file. As to the port, it´s 587 according to my mailserver provider.

    My God, this is embarrassing. I act $mail->AltBody = 'We recieved your e-mail. Thank you for contacting us. We will get back to you as soon as possible. Sincerely, PERFECT NME';

    So... I mange to get the confirmation e-mail as a user, but do not get the mail as the recevier. No error messages, just an empty mailbox. Any thoghts? Including the latest version of the send.php. And I have no idea how that smileyface got in there :-D

    <?php
    //Import PHPMailer classes into the global namespace
    //These must be at the top of your script, not inside a function
    use PHPMailer\PHPMailer\PHPMailer;
    use PHPMailer\PHPMailer\SMTP;
    use PHPMailer\PHPMailer\Exception;
    
    require 'src/Exception.php';
    require 'src/PHPMailer.php';
    require 'src/SMTP.php';
    
    $name = $POST['name'];
    $email = $POST['email'];
    
    //Create an instance; passing true enables exceptions
    $mail = new PHPMailer(true);
    
    try {
    //Server settings
    //$mail->SMTPDebug = SMTP:😃EBUG_SERVER; //Enable verbose debug output
    $mail->isSMTP(); //Send using SMTP
    $mail->Host = 'websmtp.simply.com'; //Set the SMTP server to send through
    $mail->SMTPAuth = true; //Enable SMTP authentication
    $mail->Username = 'XXXX@XX.com'; //SMTP username
    $mail->Password = 'XXXXXXXX'; //SMTP password
    $mail->SMTPSecure = 'TLS'; //Enable implicit TLS encryption
    $mail->Port = 587; //TCP port to connect to; use 587 if you have set SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS
    
    //Recipients
    $mail->setFrom('ronny@xxxx.com', 'PERFECT NME');
    $mail->addAddress($email, $name);     //Add a recipient
    //$mail->addAddress('ellen@example.com');               //Name is optional
    //$mail->addReplyTo('info@example.com', 'Information');
    //$mail->addCC('cc@example.com');
    //$mail->addBCC('bcc@example.com');
    
    //Attachments
    //$mail->addAttachment('/var/tmp/file.tar.gz');         //Add attachments
    //$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    //Optional name
    
    //Content
    $mail->isHTML(true);                                  //Set email format to HTML
    $mail->Subject = 'PERFECT NME - Confirmation';
    $mail->Body    = 'We recieved your e-mail. Thank you for contacting us. We will get back to you as soon as possible.<br><br>Sincerely<br><b>PERFECT NME</b>';
    $mail->AltBody = 'We recieved your e-mail. Thank you for contacting us. We will get back to you as soon as possible. Sincerely, PERFECT NME';
    
    $mail->send();
    echo 'Message has been sent';
    } catch (Exception $e) {
    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
    }

      Did you check your spam folder? (Just in case, before assuming something went wrong with sending it)

        Nothing in my spam folder, I´m afraid :-/

          Ok. this is starting to bug me out! Is there a possibillety that this is a securety issue with my email provider? Some setting on the backend or wathever since the confirmation-mail from the user shows up? Ivé googled my ass off and cannot find anyone having this issue. At the same time I´ve looked at so many examples of the php-contact files without finding an explanation for my issue. Why do the sender get a confirmation and reciever get nothing?
          I´ve edited the the code somwhat during this, so if anyone would like to help I will post the code again :-)

            Glancing through your latest code, it looks to me like this is the only email that would receive anything:

            $mail->addAddress($email, $name);     //Add a recipient
            

            If you're saying that whoever is $email is receiving it but someone else is not, then you probably just need to add another addAddress() for "someone else" (or addCC() or addBCC() if more applicable).

            NogDog Thanks. That makes sence. Somhow I thougt
            $mail->setFrom('ronny@xxxx.com', 'PERFECT NME');
            was the recipiant of the form. Did not occur to me that turorial I followed was just about the confirmation email.
            I´ll look in to this.

              I have abandoned the PHPMailer and started over with a simple php mail form. I am now recieving the e-mail but for some reason the input field for ""name" doesn´t show up in the recieved e-mail (The others show up). It sais "Name:" but then it´s blank.
              Posting the html and php and hoping someone sees what I´m missing.

              <form class="ajax-form" data-message-class="colors-e background-95 border heading" action="contact-form-handler.php" method="post" novalidate="novalidate">
              										<div class="row">
              											<div class="col-md-6 control-group">
              												<div class="alt-placeholder">Name</div>
              												<input type="text" name="name" value="" size="40" placeholder="Name" data-validation-required-message="Please fill the required field." required>
              												<div class="help-block"></div>
              											</div>
              											<div class="col-md-6 control-group">
              												<div class="alt-placeholder">Email</div>
              												<input type="email" name="email" value="" size="40" placeholder="Email" data-validation-required-message="Please fill the required field." required>
              												<div class="help-block"></div>
              											</div>
              											<div class="col-md-12 control-group">
              												<div class="alt-placeholder">Message</div>
              												<textarea name="message" placeholder="Message" data-validation-required-message="Please fill the required field." required></textarea>
              												<div class="help-block"></div>
              											</div>
              											<div class="col-md-12 form-actions">
              												<input class="button" type="submit" value="Send">
              												
              											
              											</div>
              										</div>
              									</form>
              <?php 
              
              $myemail = 'contact@perfect-nme.com';//<-----Put Your email address here.
              if(empty($_POST['name'])  || 
                 empty($_POST['email']) || 
                 empty($_POST['message']))
              
              
              $name = $_POST['name']; 
              $email_address = $_POST['email']; 
              $message = $_POST['message']; 
              
              $successMessage = 'Message successfully sent!';
              
              
              {
              	$to = $myemail; 
              	$email_subject = "PNME Contact Form: $name";
              	$email_body = "You have received a new message. ".
              	" Here are the details:\n Name: $name \n Email: $email_address \n Message \n $message"; 
              	
              	$headers = "From: $myemail\n"; 
              	$headers .= "Reply-To: $email_address";
              	
              	mail($to,$email_subject,$email_body,$headers);
              	
              } 
               
              	echo($successMessage);
              
              
              
              ?>

                The posted php code is only assigning $name = $_POST['name'] IF one or more of the inputs is empty, because there's no {} around any code immediately following that conditional test and the purpose of those empty() tests was (probably) to setup a message if a 'required' input is empty, not to run the form processing code.

                Post method form processing code should -

                1. Be on the same page as the form, so that you can populate the form field values with the existing data upon an error, when you display the errors and redisplay the form.
                2. Detect if a post method form was submitted before referencing any of the form data.
                3. Keep the form data as a set in an array variable, the use elements in this array variable through the rest of the code.
                4. Trim all the input data at once (you can do this with one single php statement.)
                5. Validate all inputs, storing validation errors in an array using the field name as the array index.
                6. If there are no error after the end of the validation logic (the array holding the errors will be empty), use the submitted form data.
                7. Do not copy variables to other variables for nothing. This is just a waste of your time typing.
                8. Do not put external, unknown, dynamic values into the Subject parameter, e.g. the $name.
                9. Apply htmlentities() to any value being used in a html context to help prevent cross site scripting when the email are read using a browser.
                10. Validate the format of the submitted email address before using it to insure it only consists of exactly and only one properly formatted email address to prevent mail header injection.
                11. You must test for a true value returned from the mail() call to decide if the success message should be setup and displayed. For a false value, you should LOG the data so that you will both know that emails are failing and so that you can see if anything about the data is causing the failure.
                12. Upon successful completion of the form processing code, you should redirect to the exact same url of the current page to cause a get request for that page. This will prevent the browser from trying to resubmit the form data should the page get reloaded or the visitor browses away from and back to the page.
                13. If you want to display a one time success message, store it in a session variable, the test, display, and clear that session variable at the appropriate location in the html document.

                pbismad Thank you! That was it. Allso thank you for the list. That was very informative!

                  5 days later

                  Your code is vulnerable to email header injection. You should validate this variable to make sure it contains ONLY an email address and does NOT contain any newline chars:

                  $email_address = $_POST['email']; 
                    Write a Reply...