• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

PHP Mail With Values From 2 Sources

A form on my Web site sends its submitted values to a php page on my server (Apache), which then emails them to me.

The form values are also sent to a payment gateway, which creates some new values (Authorization Code, Transaction ID, etc.). I have the gateway configured to send its new values to another page on my server, which then sends them to me in a 2nd email.

I would like to send myself all values in a single email instead of 2 separate ones. But how would I go about doing this? I guess my question is: Can php code be written that would save values from 2 different sources, at 2 different times (a delay of probably 1 or 2 seconds), and then send a single email?
0
Jonathan Greenberg
Asked:
Jonathan Greenberg
  • 2
  • 2
2 Solutions
 
QualitySoftwareDevelopmentCommented:
You could store the first email in a sessionand then connect it with the second email and send them together
0
 
Chris GralikeSpecialistCommented:
Yes, you can.

You can use a session like QualitySoftware suggests, You can make a script wait for the response, you might store the data in some database until all data is collected and then send if to you. You could use the database to send the mail based on a stored procedure / database job. There are many approaches that might solve this for you.

0
 
Jonathan GreenbergAuthor Commented:
Thank you both for your comments.

Chris, one of your options was to "make a script wait for the response." I want to be clearer about what this means. Does this mean my script could receive the values from my Web form, wait until the response comes in from the payment gateway, and then send all values at once? If so, could it do this without using a session and/or a database?
0
 
Jonathan GreenbergAuthor Commented:
I figured it out.  Thanks again.
0
 
Chris GralikeSpecialistCommented:
Sorry i did not get back to you sooner. Im happy you figured it out :-)

If we can be of more assistance just let us know :-)

rgrds,
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now