Title: frenil75's Replies | WordPress.org

---

# frenil75

  [  ](https://wordpress.org/support/users/frenil75/)

 *   [Profile](https://wordpress.org/support/users/frenil75/)
 *   [Topics Started](https://wordpress.org/support/users/frenil75/topics/)
 *   [Replies Created](https://wordpress.org/support/users/frenil75/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/frenil75/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/frenil75/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/frenil75/engagements/)
 *   [Favorites](https://wordpress.org/support/users/frenil75/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form 7] Additional Date header DATE_RFC2822](https://wordpress.org/support/topic/additional-date-header-date_rfc2822/)
 *  Thread Starter [frenil75](https://wordpress.org/support/users/frenil75/)
 * (@frenil75)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/additional-date-header-date_rfc2822/#post-4982406)
 * If I add them to classes.php line 728
 *     ```
       $additionaldate = date(DATE_RFC2822);
       		$additionalmid = "<" . sha1(microtime()) . "@" . $_SERVER['HTTP_HOST'] . ">";
       		$headers .= "Date: ". $additionaldate ."\n";
       		$headers .= "Message-ID: ". $additionalmid . "\n";
       ```
   
 * it works, but is there a way to set them directly in Additional Header-area instead?(
   so that the will not be overwritten when upgrading the plugin?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form 7] Additional Date header DATE_RFC2822](https://wordpress.org/support/topic/additional-date-header-date_rfc2822/)
 *  Thread Starter [frenil75](https://wordpress.org/support/users/frenil75/)
 * (@frenil75)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/additional-date-header-date_rfc2822/#post-4982390)
 * The web hosting service does not set it automatically and requires them to be
   set.
 * If I run their example, below, I can send mail to external gmail, but not via
   wordpress and cf7
 *     ```
       <?php
       // Data för mailet
       $sender = "noreply@mywordpressdomain.se";
       $sendername = "My page";
       $recipient = "mygmailadress@gmail.com";
       $recipientname = "My name";
       $subject = "Subject for the mail";
       $message = "mail content";
   
       // Generera datum och mailets id
       $date = date(DATE_RFC2822);
       $mid = "<" . sha1(microtime()) . "@" . $_SERVER['HTTP_HOST'] . ">";
   
       // Ställ in rätt kodningstyp
       mb_internal_encoding("UTF-8");
   
       // Rätt kodning för avsändare och mottagares namn
       $sendername = mb_encode_mimeheader($sendername);
       $recipientname = mb_encode_mimeheader($recipientname);
   
       // Sätt headers
       $headers =<<<EOT
       From: $sendername <$sender>
       Date: $date
       Message-ID: $mid
       MIME-Version: 1.0
       Content-Type: text/plain; charset="UTF-8"
       EOT;
   
       // Skicka mail
       $status = mb_send_mail("$recipientname <$recipient>", $subject, $message, $headers, "-f$sender");
       if(!$status) {
               echo "Mail kunde inte skickas.";
       }
       else {
               echo "Mail skickat!";
       }
       ?>
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)