WordPress.org

Ready to get started?Download WordPress

Forums

Simple Basic Contact Form
[resolved] multiple email recipients (3 posts)

  1. colorlink
    Member
    Posted 7 months ago #

    multiple email recipients is it possible?
    is there a way around it if not?
    many thanks

    http://wordpress.org/plugins/simple-basic-contact-form/

  2. colorlink
    Member
    Posted 7 months ago #

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

    like.

    blahblah@blah.com , sajsaja@jhajaj.com

    . many thanks

  3. Jeff Starr
    Member
    Plugin Author

    Posted 6 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic