keithedwardb
asked on
PHP email string problem
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.
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"
Any ideas where my issue is, please?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As they say in the English Language, you need to know when to use a comma and when to use a semi-colon - it applies equally to syntax. Thanks for your help. It was quick and painless and answered all my issues and saved many (more) hours of frustration. The page now works perfectly.
Thanks again.
Thanks again.
Open in new window