Printer Friendly Version
Email this thread to a friend
|
Featured Web Site Template |
|
Reflects user activity within the last 5 minutes
|
|
| Member |
Message |
TracyJ
Joined: Eons Ago
# Posts: 592
|
Posted: 2004-Apr-20 22:16
As I continue to fumble my way through my first real site using PHP, I have yet another question...
I have many instances on our old site of CGI form processing where the script has to send two different emails out, one to our company and one to the customer. How do I do this in PHP? If I just call the mail() function twice for the two different emails, the second one doesn't get sent.
Thanks again in advance,
Tracy
|
 |
NEntropy
Joined: Dec 08, 1999
# Posts: 1117
|
Posted: 2004-Apr-23 19:50
Hmm, you should be able to call mail twice to send two messages. Another possibility is setting 2 email addresses in the 'to' field, separated by comma. I seem to recall it working in PHP's mail function...
|
 |
TracyJ
Joined: Eons Ago
# Posts: 592
|
Posted: 2004-Apr-23 19:55
Problem is, it's two different messages, so I can't just do two email addresses in the 'to' field.
It's not working at all, and when I posted on another forum, someone else said there shouldn't be any problem... and yet... there is! Argh.
|
 |
TracyJ
Joined: Eons Ago
# Posts: 592
|
Posted: 2004-Apr-23 23:50
Finally figured it out. I don't know why it makes a difference, but if I use "return mail()" it doesn't work. If I just call "mail()" it works.
|
 |
NEntropy
Joined: Dec 08, 1999
# Posts: 1117
|
Posted: 2004-Apr-25 00:34
Ah, that's because if you do return mail(); then after that command is run, the control of the software goes to the original calling function... Say you have the following code:
1 - function test(){
2 - command
3 - command
4 - return command
5 - command
6 - }
The commands in lines 2, 3, 4 are run, but it never gets to line 5, because the "return" keyword in line 4 will make the script jump over the line 5 and go directly to the original calling command.
|
 |
TracyJ
Joined: Eons Ago
# Posts: 592
|
Posted: 2004-Apr-26 19:29
Gotcha. That makes a lot of sense. Gee, I'm such a newbie! Thanks for helping me figure it out.
|
 |
You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
- You have not yet logged in, or registered properly as a member
- You are a member, but no longer have posting rights.
- This is a private forum, for which you do not have permissions.
If you are a recent member, it's possible that you simply have not yet confirmed your account. Please
check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions
contained within.
If you cannot find this message, click here to Re-Send it.
|
If you are still experiencing problem, please read the
Login Assistance
Article for some advice on what may be causing your login not to work properly.
|
Switch to Advanced Editor and ...
Create a New Topic
or Reply to this Thread
|
|