We help IT Professionals succeed at work.
Get Started

PHP email string problem

keithedwardb asked
Last Modified: 2012-08-14
Hi Experts,
I have a php page that for the most part works as designed.  I have one issue.
The page sends two emails, one after the other.
The first email only seems to work if one email address is used in 'To' section.  As soon as I try to concatanate a string that contains, say, 2 or more email addresses, the email fails to send.

The syntax I am using is:
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

for example if I use $pfw_email_to ="a.nother@isp.com";.  the function works fine and the email goes to a.nother@isp.com.

However, if I use, $pfw_email_to = "a.nother@isp.com; asecondperson@hotmail.com"; the email fails to send to either.  My original reason for looking at this is that I wanted to control the recipients from a string, so that if people change places / email address, etc I can simply have one string to alter leaving the base code intact.
Any ideas where my issue is, please?
Thank you.
Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE