Hi, I’m trying to have this code send the same identical email that goes to “$youremail”, to also go to the “E-Mail [email]” address. Any guidance with this, will be appreciated: Here’s the current code:
Or if you want to explicitly send it separately, just duplicate the line that actually sends the mail and use the alternate email address, though wrap it in an if() check to make sure there’s something in it, though as @chorn alluded to above, there are plenty of issues with using the in-built mail() function that suggest you should also look at using something else to send the email, while you’re in there.
You may also come into some issues if you try to send your email using the address supplied in the form as the from-address - many email servers will only send emails from a domain that they’re configured for. In my opinion, you should always send emails like this from an address that you own, and maybe use the reply-to header if there’s a need to be able to respond to them directly.
Thanks for all the help/replies. This code below works successfully, the only thing I can’t figure out is that when I open up the first email sent it shows that it was sent from: wcform@real…com, but the second email shows that it was sent from an email address pertaining to the server, how can I have the second email show it’s from wcform@real…com?
Here’s the current code:
Your code specifies the from-address, it’s in your first post. It’s not in this latest post of the working code, presumably you just snipped that bit out for the post. If you’re not specifying a from-address, I guess it’s down to your server what it sends, though you would expect it to be consistent.