Web Analytics Made Easy -
StatCounter Download after sale - CodingForum

Announcement

Collapse
No announcement yet.

Download after sale

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Download after sale

    Hi,

    I'm familiar with JavaScript and HTML but have no server side experience. Here is what I'd like to do and any advice and help on
    how to implement it would be greatly appreciated.

    I sell a an e-guide and use paypal as a credit card merchant.
    After a customer makes a payment I get an email from paypal.
    Once I verifly payment I email the guide. Paypal also returns the customer to an html thankyou page that I provide. I'd like to automate that process where they can just download the guide
    without waiting for me to email it. ('im also running into all kinds of problems with free email accounts, ie.. limitations on file xfer and mail box sizes, full mailboxes etc.) I could have the thankyou page contain a link they could click to download the guide but this is not secure enough.

    Thanks
    Laundry Bag Store Online

  • #2
    check out MIME::Lite at CPAN for more documentation. This is something i put together, but didn't test. you'll have to adapt the script to your specific environment.

    Code:
    #!/perl
    
    use MIME::Lite;
    
    ### Create the multipart "container":
    $msg = MIME::Lite->new(
    	From    =>	'[email protected]',
    	To      =>	'[email protected]',
    	Cc      =>	'[email protected], [email][email protected][/email]',
    	Subject =>	'A message with 2 parts...',
    	Type    =>	'multipart/mixed'
    );
    
    ### Add the text message part:
    $msg->attach(
    	Type	=>	'TEXT',
    	Data	=>	"Here's the e-guide you ordered. Check out my other products!"
    );
    
    ### Add the guide part:
    $msg->attach(
    	Type     =>	'guide',
    	Path     =>	'guide.pdf',
    	Filename =>	'guide.gif',
    	Disposition =>	'attachment'
    );
    ### START ONLY USE IF NO SENDMAIL ###
    MIME::Lite->send('smtp', "smtp.myisp.net", Timeout=>60); # will use Net::SMTP to send
    ### END ONLY USE IF NO SENDMAIL ###
    
    $msg->send;
    "There is more than one way to do it."

    Comment


    • #3
      there is a list of MIME types here:http://www.iana.org/assignments/medi...pes/index.html for reference.
      "There is more than one way to do it."

      Comment

      Working...
      X