WordPress.org

Plugin Directory

Changeset 616413


Ignore:
Timestamp:
10/23/12 17:49:11 (18 months ago)
Author:
tmoorewp
Message:

Contact Form: Send the contact form from a donotreply type address. Otherwise, the hosing server may regard the mail as spam and not send it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jetpack/branches/1.8/modules/contact-form/grunion-contact-form.php

    r588176 r616413  
    455455    } 
    456456 
    457     $from_email_addr = $to[0]; 
    458     if ( !empty( $comment_author_email ) ) { 
    459         $from_email_addr = $comment_author_email; 
    460     } 
    461  
    462     $headers = 'From: ' . wp_kses( $comment_author, array() ) . 
    463         ' <' . wp_kses( $from_email_addr, array() ) . ">\r\n" . 
    464         'Reply-To: ' . wp_kses( $from_email_addr, array() ) . "\r\n" . 
     457    $blog_url = parse_url( site_url() ); 
     458    $from_email_addr = 'wordpress@' . $blog_url['host']; 
     459 
     460    $reply_to_addr = $to[0]; 
     461    if ( ! empty( $comment_author_email ) ) { 
     462        $reply_to_addr = $comment_author_email; 
     463    } 
     464 
     465    $headers = 'From: ' . wp_kses( $comment_author, array() ) . ' <' . wp_kses( $from_email_addr, array() ) . ">\r\n" . 
     466        'Reply-To: ' . wp_kses( $comment_author, array() ) . ' <' . wp_kses( $reply_to_addr, array() ) . ">\r\n" . 
    465467        "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"";  
    466468    $subject = apply_filters( 'contact_form_subject', $contact_form_subject ); 
Note: See TracChangeset for help on using the changeset viewer.