title: wp_mail() function taking too long to deliver single mail
body: <p>I have the following code which sends a single email to my account. However, this takes about 3-5 minutes after the user submits the form. Is there anyway to reduce the delivery time or is this just what the wp_mail() function takes all the time? This is my code: </p>
  
  <pre><code>    if ($_POST['task-title'] &amp;&amp; $_POST['task-description'] &amp;&amp; $_FILES['task-files']['size']&lt;20971520){
      $mailto = array('example@email.com');
      $subject = 'Task "'.$_POST['task-title'].'" ('.$_POST['task-priority'].')';
      $body = 'Client: '.$user_name.'
  
      Task title: '.$_POST['task-title'].'            
      Category: '.$_POST['task-category'].'           
      Priority: '.$_POST['task-priority'].'
  
      Description:
      '.$_POST['task-description'];
  
      $headers = 'From: '.$user_name.'&lt;'.$current_user-&gt;user_email.'&gt;';
      move_uploaded_file($_FILES["task-files"]['tmp_name'], WP_CONTENT_DIR.'/uploads/'.basename($_FILES['task-files']['name']));
      $attachments = array(WP_CONTENT_DIR."/uploads/".$_FILES["task-files"]['name']);   
  
      wp_mail($mailto, $subject, $body, $headers, $attachments);
  </code></pre>
  
  <p>I thought about setting up a cronjob to send the unsent emails every minute but I'd be using wp_mail() again so it'd be the same anyways wouldn't it?</p>