• Resolved schulz

    (@schulz)


    Isn’t this redundant?

    // Send all the emails to Administrator
        $mail["to"] = get_option( "admin_email" );
        
        // Send a BBC copy of the email to Administrator
        $mail["headers"][] = "BBC: " . get_option( "admin_email" );

    Send all the emails to Administrator then send a BBC copy of the email to Administrator?
    Shouldn’t the first line of code send to the ad author not the admin? Actually the ‘BBC’ should be ‘BCC’ no?

    How do I change the $mail[“to”] to send to the ad author?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter schulz

    (@schulz)

    Sorry for the barrage of questions, it was a late night and wondered how this snippet had gone unnoticed for so long this way (thought there was a reason I missed).

    Anyway, the one and only question that I really need answered is:

    How do I change the $mail[“to”] to send to the ad author or better yet contact email for the ad?

    Thanks for the great plugin and your help.

    BTW: I’m not a programmer/coder nor do I play one on TV.

    Plugin Author Greg Winiarski

    (@gwin)

    The $mail["to"] is set to Ad owner by default, so from the code snippet pasted above you can just remove the line

    
    $mail["to"] = get_option( "admin_email" );
    

    and the Ad will be sent to Author or more precisely to the email address entered in Contact Email field when posting an Ad.

    Thread Starter schulz

    (@schulz)

    That was one of the first things I tried, however I think that was before I discovered the “BBC vs BCC” error. I guess that is why it did not work then.

    I commented out that line and fixed the BCC issue, however when I do that the contact form pauses for a few seconds when you press [ Send Message ] button. The form submission is normally instant? (however does work)

    If I don’t comment out/remove that line the form submission is instant again? However then the AD contact doesn’t get the message.

    Plugin Author Greg Winiarski

    (@gwin)

    It looks like your sendmail program installed on the server is somehow causing a delay and ignores the BCC header.

    One thing you can do is install and configure a plugin like https://www.ads-software.com/plugins/wp-mail-smtp/ this will send emails via SMTP, the BCC header should be respected and there should not be any delay (other than a delay needed to connect to SMTP server).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘contact form snippet’ is closed to new replies.