?
Solved

PHP Mail With Values From 2 Sources

Posted on 2009-04-16
5
Medium Priority
?
193 Views
Last Modified: 2013-12-12
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
Comment
Question by:Jonathan Greenberg
  • 2
  • 2
5 Comments
 
LVL 3

Assisted Solution

by:QualitySoftwareDevelopment
QualitySoftwareDevelopment earned 800 total points
ID: 24165346
You could store the first email in a sessionand then connect it with the second email and send them together
0
 
LVL 11

Accepted Solution

by:
Chris Gralike earned 1200 total points
ID: 24165835
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
 

Author Comment

by:Jonathan Greenberg
ID: 24176589
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
 

Author Comment

by:Jonathan Greenberg
ID: 24181713
I figured it out.  Thanks again.
0
 
LVL 11

Expert Comment

by:Chris Gralike
ID: 24182734
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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question