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.
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.
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://ww.wp.xz.cn/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).