0

I have a demo ( not real ) piece of code below, just to give you an idea of what I want to accomplish.

function submitCart()
{
    var emailcontent = window.open('about:blank', 'emailcontent');
    var emailBody = emailcontent.document;
    emailBody.open();
    emailBody.write($('.home_page_container').html())
    $('.home_page_container').html()
    emailBody.close();
}

This code, at the moment, very nicely duplicates the Shopping Cart and opens it in a new page. However, that isn't what I want to do. Rather than opening it as a new page, I want to send it as an email to a company that is helping me with my orders.

How do I send the html displayed by this line of code, as either an email attachment, or the body of the email?

$('.home_page_container').html()
bhardy
  • 83
  • 10
  • Step 1: Pick a server side programming language. – Quentin Sep 26 '16 at 17:33
  • No way to do this on the client side? – bhardy Sep 26 '16 at 17:34
  • 1
    Maybe this can be usefull for your problem: http://stackoverflow.com/questions/7381150/how-to-send-an-email-from-javascript – Lenon Bordini Sep 26 '16 at 17:39
  • I read that entry, actually, and was hoping that things might have changed since 2011. :) Ok, i'll stop looking for client side solutions. – bhardy Sep 26 '16 at 17:43
  • 1
    @bhardy — If you wanted to do it client side, why did you tag this [tag:ajax]? (But no, you can't do this client side). – Quentin Sep 26 '16 at 17:43
  • Because, I am aware of the possibility that I may be forced to do this server side only. I was just HOPING that there might now be simple way to send client generated shopping cart. – bhardy Sep 26 '16 at 17:46
  • Use Google docs or similar collaborative document environment. – Justin Herter Sep 26 '16 at 17:46
  • No Justin, my orders will get that lost that way. The helping company already checks their email because that is how they receive orders from their own clients. I want them to treat my orders just like they would an order from one of their own clients. Its ok, I can do this server side, its just more code than I was hoping to write. – bhardy Sep 26 '16 at 18:04
  • Thanks everyone for confirming what I guess I already knew, but didn't want to accept. – bhardy Sep 26 '16 at 18:07

0 Answers0