WordPress.org

Support

Support » Plugins and Hacks » Simple Basic Contact Form » [Resolved] multiple email recipients

[Resolved] multiple email recipients

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

    @colorlink

    nm …
    all you have to do is to set a comma between

    like.

    blahblah@blah.com , sajsaja@jhajaj.com

    . many thanks

    Plugin Author Jeff Starr

    @specialk

    That’s one way of doing it, or you can locate this chunk of code:

    if ($scf_options['scf_mail_function'] === 1) {
            mail($recipient, $topic, $fullmsg, $headers);
            if ($carbon == 1) mail($email, $topic, $fullmsg, $headers);
    } else {
            wp_mail($recipient, $topic, $fullmsg, $headers);
            if ($carbon == 1) wp_mail($email, $topic, $fullmsg, $headers);
    }

    ..as you can see, there is a conditional statement that determines if email is sent using mail() or wp_mail(). Adding more addresses would be done like so:

    if ($scf_options['scf_mail_function'] === 1) {
            mail($recipient, $topic, $fullmsg, $headers);
            mail('another@recipient.com', $topic, $fullmsg, $headers);
            mail('and-another@recipient.com', $topic, $fullmsg, $headers);
    
            if ($carbon == 1) mail($email, $topic, $fullmsg, $headers);
    } else {
            wp_mail($recipient, $topic, $fullmsg, $headers);
            wp_mail('another@recipient.com', $topic, $fullmsg, $headers);
            wp_mail('and-another@recipient.com', $topic, $fullmsg, $headers);
    
            if ($carbon == 1) wp_mail($email, $topic, $fullmsg, $headers);
    }

    Alternately you could use Cc/Bcc by adding to the $headers variable, or even some combination of methods, whichever works best for you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] multiple email recipients’ is closed to new replies.
Skip to toolbar