We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Automatic email

Medium Priority
Last Modified: 2012-05-05
I need to know how to code something that when I get paid through paypal, will send them an automatic email with a password in it. Whoever could help me out would be greatly appreciated.
Watch Question

Are you talking about a link on your site that people use to pay you through or are you talking about when someone actually goes to paypal? if it is the latter of the two, you would have to write a script that would automatically connect to PayPal every so many minutes and check if the transactions have changed and then kick off and e-mail.

What is this going to be used for?

Are you sending yourself your own password?

I'm not sure I understand you either.
If you want to accept payments by paypal on your site look at the "3 powerful solutions" outlined in https://www.paypal.com/uk/cgi-bin/webscr?cmd=_merchant.  Buy Now Buttons are probably want you need.

The way you setup Buy Now buttons, you don't need users to have or need any password other than their own Paypal one!
You should also update you paypal account to a business one if you haven't already done this.
The default is that when you receive a new paypal payment you will get emailed, but it's optional.

So you are managing all the code for processing the payments and sending the information to PayPal? I'm sorry I haven't worked a whole lot with PayPal, but I'm sure if I can understand your predicament a little better I'll be able to help you.


No, No,
They buy through the buy now button, and then I need something to send an email to them once I recieve a payment. The email will contain a download password for the ebook product.

Oh, couldn't you use Outlook, setup a rule of some kind

They will get an email anyway from Paypal I think so maybe you don't need to do anything???!!!

Okay, so what you would probably want to do is write a script that will either:

Scan your e-mail and send an e-mail off when you have recieved payment. It would have to parse the e-mail and look for keywords.


Log into your paypal account find any new, approved transactions and the e-mail address for them and then send the e-mail.


So what script would I use that would send of an email when I recieve a payment?
I dont think you can write any customised mail from paypal itself.
Paypal uses two URLs:
1)For successfull transaction
2)For unsuccessfull transaction
we can supply the successfull transaction return URL and unsuccessfull transaction return URL from the page which is sending control from your website to paypal.
To do that you have to take 2 hidden fields-
1)<input type="hidden" name="return" value="<%=return_url%>">
2)<input type="hidden" name="cancel_return" value="<%=cancel_url%>">
If return URL does not work this way you can write the return url in the paypal also.

I am assuming you already have the username and password of the user in session,or a cookie which you have stored in [server/client] before going to paypal.
Now you write the mailing code in the success URL page and then redirect the control to desired page from there.

Hope it will solve your problem.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.