PHP: Send mail using email address in a variable? 10 points for best answer?
-
I'm trying to do this - mail('[email protected] , $contactemail', 'Booking Confirmation', $message, $headers); Everything is working BUT $contactemail. as you can see, the first email address is fixed, and the mail goes there, but the second should be going to an email address stored in a variable. When sent to the fixed address, it says it was also sent to [email protected] (the variable has not been replaced).Why is this not working??? Thanks in advance.
-
Answer:
If you want to expand variable names in a string like that, you need to enclose your string in "double quotes". Variable expansion is not performed on string literals that are enclosed in 'single quotes'.
Matthew at Yahoo! Answers Visit the source
Other answers
PUt the recipients in a string, use the string in the mail function - good example below, the PHP manual.
Control Muncher
Related Q & A:
- How can you block an email address in a Yahoo email account?Best solution by Yahoo! Answers
- Is there a way where u can send someone an email using hotmail and adding a small picture in the?Best solution by Yahoo! Answers
- How do you change your old email address to a new one?Best solution by Yahoo! Answers
- Can I send a picture message to my phone from my email address?Best solution by ChaCha
- How do I add all my contacts from an old email address to a new email address on msn?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.