JavaScript - Send Html Email In Microsoft Outlook
Hi,
I am new to Microsoft Outlook. I want to send a email using Microsoft Outlook. But that needs to send HTML email , I have tried for this but not getting the solution. I tried a lot by using <html> but it doesn't work. The code i have used is given below. Could you guys please help me out in this. Please make me know how can I send my email in html using Outlook Express ? .aspx.cs Quote: private void SendMail(DropDownList ddllist, TextBox txtTitle, TextBox txtSubSystem) { string email = string.Empty; string lastName = string.Empty; string title = string.Empty; string subsystem = string.Empty; string task = string.Empty; string issue_id = string.Empty; try { //DropDownList ddlAssignedTo = (DropDownList)fvIssue.FindControl("ddlAssignedTo"); string tb_assigned_to = ddllist.SelectedValue; task = Request.Url.OriginalString.ToString(); issue_id = Request.Url.OriginalString.ToString().Split('=')[2]; title = txtTitle.Text.Replace("'", " "); subsystem = txtSubSystem.Text.Replace("'", " "); if (tb_assigned_to != null) { if (tb_assigned_to.Equals(ConstValues.SCANNER_GROUP) || tb_assigned_to.Equals(ConstValues.SERVER_GROUP) || tb_assigned_to.Equals(ConstValues.TEST_GROUP)) { Session["emailTo"] = Util.GetGroupEmails(tb_assigned_to); } else { CdsContactBLL contact = new CdsContactBLL(); email = contact.EmailAddress(tb_assigned_to); if (email != string.Empty) Session["emailTo"] = email; else Session["emailTo"] = tb_assigned_to + "_DOES_EXIST_IN_CDS_CONTACT@datascanlp.com"; } } else Session["emailTo"] = "TO_EMAIL_GOES_HERE@test.com"; } catch (Exception ex) { Session["emailTo"] = "TO_EMAIL_GOES_HERE@test.com"; } InjectScript.Text = "<script type=\"text/javascript\">EmailIt('" + task + "','" + issue_id + "','" + Session["emailTo"].ToString() + "','" + title + "','" + subsystem + "')</script>"; } SendEmail.js Quote: // JScript File function EmailIt(task,issue_id,emailTO,strTitle,strsubsystem) { //win = window.open("...\\Issues\\HTMLPage3.htm"); var daReferrer = document.referrer; //var task = escape(document.URLUnencoded); //var issue_id = document.URLUnencoded.split("="); var email = emailTO; var title = strTitle; var subsystem = strsubsystem; var subject = "Issue Task number is " + issue_id + " - " + escape(title) ; var body_message = " Your Assigned Task is.%0D " + escape(task); body_message += escape("\n"); body_message += escape("\n"); body_message += " Sub System : " + escape(subsystem); body_message += escape("\n"); body_message += " Title : " + escape(title); body_message += escape("\n"); var mailto_link = 'mailto:'+email+'?subject='+subject+'&body='+body_message; win = window.open(mailto_link); if (win && win.open &&!win.closed) win.close(); //window.history.back(-1); } Regards, vimal kumar srivastava Madhepura,India Similar TutorialsI'm creating a validation form. It's basic information but I want the form to be sent to my email after the form has been validated. My problem right now is when I hit submit my email comes up so I can send it to the assigned email address. It's not checking for errors first. I have created 5 different validation forms and I'm running across the same problem. I'm not sure if it's a function or form issue maybe even both. Any advice would be highly appreciated. Code: <script type="text/javascript"> /* <![CDATA[ */ /* ]]> */ function checkForNumber(fieldValue) { var numberCheck = isNaN (fieldValue); if (numberCheck ==true) { window.alert("You must enter a numeric value!"); return false; } else return true; } function checkForLetter(fieldValue) { var alphaCheck= /^[A-Za-z]+$/ (fieldValue); if (alphaCheck == true) { window.alert("You must enter letters only!"); return false; } else return true; } function checkEmail(fieldValue) { var emailCheck = /^\w+([/.-]?\w+)*@\w+([\-]?\w+)*(\.\w{2.3})+$/ (fieldValue); if (emailCheck == true) { window.alert("Please enter a valid email address!"); return false; } else return true; } function checkAlphanumeric(fieldValue) { var alphanumericCheck = /^[0-9a-zA-Z]+$/ (fieldValue); if (alphanumericCheck == true) { window.alert("Please enter an alphanumeric address!"); return false; } else return true; } function buttonPic() { for (var i=0; i<document.forms.morePic.length; ++i) { if (document.forms[0].morePic[i].checked == true) { document.forms[0].morePic[i].checked = false; break; } } } function checkPurch() { for (var j=0; j<document.forms.purchase.length; ++j) { if (document.forms[0].purchase[j].checked == true) { document.forms[0].purchase[j].checked = false; break; } } } function confirmSubmit() { var submitForm = window.confirm("Are you sure you want to submit form?"); if (document.forms[0].name_info.value == "" || document.forms[0].address_info.value == "" || document.forms[0].city_info.value == "" || document.forms[0].state_info.value == "" || document.forms[0].zip_info.value == "") { window.alert("You must enter your address."); return false; } else if (document.forms[0].validateEmail.value == "") { window.alert("Please enter a email address where I can contact you."); return false } var picSelected = false; for (var i=0; i < 2; ++i) { if (document.forms[0].morePic[i].checked == true) { picSelected = true; break; } } if (picSelected! = true) { window.alert("Please select if you would like more pictures."); return false; } var purchSelected = false; for (var j=0; j<2; ++j) { if (document.forms[0].purchase[j].check == true) { purchSelected = true; break; } } if (purchSelected! = true) { window.alert("Please select if you are interested in one or two vehicles."); return false; return true; } function confirmReset() { var resetForm = window.confirm("Are you sure you want to reset this form."); if (resetForm == true) return true; return false; } } </script> </head> <body> <p>Full Name:<input type="text" name="name_info" size="30" onblur="return checkForLetter(this.value);"/></p> <p>Street Address:<input type="text" name="address_info" size="50" onblur="return checkAlphanumeric(this.value);"/></p> City:<input type="text" name="city_info" size="20" onblur="return checkForLetter(this.value);"/>     State: <select name="state_info"> <option value="chooseYourState">Choose Your State</option> <option value="alabama">Alabama</option> <option value="alaska">Alaska</option> <option value="arizona">Arizona</option> </select>     Zip Code: <input type="text" name="zip_info" size="10" onblur="return checkForNumber(this.value);"/></p> Email Address: <input type="text" name="validateEmail" size="30" onblur="return checkEmail(this.value);"/></p> <p>Would you like more pictures sent to your email?</p> <input type="radio" name="morePic" value="Yes" onblur="return buttonPic();"/>Yes         <input type="radio" name="morePic" value="No" onblur="return buttonPic();"/>No <p>Are you thinking about purchasing one or two vehicles?</p> <input type="checkbox" name="purchase" value="One" onblur="return checkPurch();"/>One         <input type="checkbox" name="purchase" value="Two" onblur="return checkPurch();"/>Two <form action="mailto:abc@yahoo.com" method="get"> <p><input type="submit" value="Send" onsubmit="return confirmSubmit();"/> <input type="reset" value="Reset" onreset="return confirmReset();"/></p> </form> Hello I'd like to open using JS an outlook send mail window having a file from the server (full url, that should work, right ?) attached. Is this possible ? If so, please tell me how. Thanks Hey All, Been having some trouble with this, I am trying to find a javascript or DHTML form field which is similar to the outlook web access email address fields which show an icon to identify the address, and the screen name of the address instead of the full email address, as a hyperlink. I was wanting to know if anyone knows of something like this already around or if I need to design my own. Thanks in advance. Hi, Im using the old nopcard scripts on my site. It does every thing right except it does not send a Email to my to my email adres. I dont know how to correct this because i dont know Javascript. I include the script if anybody know how to alter it so that it will send the info to my email adres as well. Thank you very much for your previous help. Kees Meyer Oudtshoorn South Africa. The checkout.pl script : #!/usr/bin/perl #=====================================================================|| # NOP Design JavaScript Shopping Cart || # PERL CGI Checkout Module || # || # For more information on SmartSystems, or how NOPDesign can help you || # Please visit us on the WWW at http://www.nopdesign.com || # || # Javascript portions of this shopping cart software are available as || # freeware from NOP Design. You must keep this comment unchanged in || # your code. For more information contact FreeCart@NopDesign.com. || # || # JavaScript Shop Module, V.4.4.0 || #=====================================================================|| # || # Function: Writes available form elements from the NOP || # Free Cart (http://www.nopdesign.com/freecart) || # and other form elements to an email file, and || # send user confirmation || # || #=====================================================================|| require 5.001; ######################################################################## # # # User defined variables: # # $header - string value containing the complete # # path of the HTML page header # # $footer - string value containing the complete # # path of the HTML page footer # # $mailprogram - string value containing the complete path to # # the sendmail binary on the system. # # $youremail - string value containing the email address to # # send catalog orders in EMAIL or BOTH modes # # **Don't forget to put a \ before the @ in your # # email address. ie. spam\@nopdesign.com*** # # $returnpage - URL to send user when checkout is complete # # $csvfilename - string value containing the complete # # path of the user database. # # $csvquote - string value containing what to use for quotes # # in the csv file (typically "" or \") # # $mode - string value containing 'EMAIL', 'FILE' or # # 'BOTH' to determine if the script should send # # an email to you with the new order, write the # # order to a CSV file, or do both. # ######################################################################## $header = "header.html"; $footer = "footer.html"; $mailprogram = "/usr/lib/sendmail -t"; $returnpage = "/"; $youremail = "support\@ebookstore.co.za"; $csvfilename = "orders.csv"; $csvquote = "\"\""; $mode = "BOTH"; #These are required fields. I recommend enforcing these by javascript, #but let's just make sure here as well. @required = ( 'b_first', 'b_last', 'b_addr', 'b_city', 'b_state', 'b_zip', 'b_phone', 'b_email' ); ############################################################## #FUNCTION: urlDecode # #RETURNS: The decoded string. # #PARAMETERS: An encoded string. # #PURPOSE: Decodes a URL encoded string. # ############################################################## sub urlDecode { my ($string) = @_; $string =~ tr/+/ /; $string =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg; $string =~ s/['"]/\'/g; return ($string); } ############################################################## #FUNCTION: processCGI # #RETURNS: # #PARAMETERS: # #PURPOSE: Retrieves form data submitted via the 'GET' # # method and decodes it. You may then access # # the passed in variables via calls to $[name] # # where [name] is the name of the form element. # ############################################################## sub processCGI { local ($cgiData, $key, $value, $pair, @pairs); if ($ENV{'REQUEST_METHOD'} eq 'GET') { $cgiData = $ENV{'QUERY_STRING'}; } else { $cgiData = <STDIN>; } @pairs = split (/&/, $cgiData); foreach $pair (@pairs) { ($key, $value) = split (/\=/, $pair); $key = &urlDecode($key); $value = &urlDecode($value); if(defined ${$key}){ ${$key} .= ", ".$value; }else{ ${$key} = $value; } } } ############################################################## #FUNCTION: doFormError # #RETURNS: # #PARAMETERS: A error message string. # #PURPOSE: Generates an HTML page indicating a form # # submission error occurred. # ############################################################## sub doFormError { my ($errString) = @_; open (HEAD, $header); @LINES = <HEAD>; close HEAD; print "Content-type: text/html\n\n"; print @LINES; print "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>"; print "$errString<BR><BR>\n"; print "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE=' Return to the checkout page '><HR>"; open (FOOT, $footer); @LINES = <FOOT>; close FOOT; print @LINES; exit; } ############################################################## #FUNCTION: doError # #RETURNS: # #PARAMETERS: A error message string. # #PURPOSE: Generates an HTML page indicating an error # # occurred. # ############################################################## sub doError { my ($errString) = @_; print "Content-type: text/html\n\n"; open (HEAD, $header); @LINES = <HEAD>; close HEAD; print @LINES; print "$errString<BR><BR>\n"; open (FOOT, $footer); @LINES = <FOOT>; close FOOT; print @LINES; exit; } ############################################################## #FUNCTION: invalidE # #RETURNS: 1 if invalid, 0 if valid. # #PARAMETERS: An email address variable. # #PURPOSE: Checks to see if a submitted email address is # # of the valid form 'x@y'. # ############################################################## sub invalidE { my ($szEmail) = @_; my ($user, $host); $szEmail =~ tr/A-Z/a-z/; if ($szEmail =~ /\s/) { return 1; } ($user, $host) = split (/\@/, $szEmail); if ($host =~ /compuserve/i) { ; } else { if (! $user =~ /\D/) { return 1; } if (! $host =~ /\D/) { return 1; } if (substr ($user,0,1) !~ /[a-z]/) { return 1; } } if ($szEmail =~ /\w+\@[\w|\.]/) { return 0; } else { return 1; } } sub populateDateVar { (Taken out because Text to long for email) "===================================================================== \n"; print MAIL "$QUANTITY_1 \R$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n"; if( $NAME_2 ) {print MAIL "$QUANTITY_2 \R$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";} if( $NAME_3 ) {print MAIL "$QUANTITY_3 \R$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";} if( $NAME_4 ) {print MAIL "$QUANTITY_4 \R$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";} if( $NAME_5 ) {print MAIL "$QUANTITY_5 \R$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";} if( $NAME_6 ) {print MAIL "$QUANTITY_6 \R$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";} if( $NAME_7 ) {print MAIL "$QUANTITY_7 \R$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";} if( $NAME_8 ) {print MAIL "$QUANTITY_8 \R$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";} if( $NAME_9 ) {print MAIL "$QUANTITY_9 \R$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";} if( $NAME_10 ){print MAIL "$QUANTITY_10 \R$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";} if( $NAME_11 ){print MAIL "$QUANTITY_11 \R$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";} if( $NAME_12 ){print MAIL "$QUANTITY_12 \R$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";} if( $NAME_13 ){print MAIL "$QUANTITY_13 \R$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";} print MAIL "===================================================================== \n"; print MAIL "SUBTOTAL: $SUBTOTAL \n"; print MAIL "TOTAL: $TOTAL \n"; print MAIL "\n"; print MAIL "\n\n"; print MAIL "Comments: \n"; print MAIL "--------- \n"; print MAIL "$comment \n"; print MAIL " \n"; close MAIL; } if( $mode eq "BOTH" || $mode eq "FILE") { $csvcomments = $comment; #$csvcomments =~ s/\"/$csvquote/ig; open (CSVF,">>$csvfilename"); print CSVF "\""; print CSVF "$months[$month] $day, $year $hour:$min:$sec"; print CSVF "\",\""; print CSVF "$b_first"; print CSVF "\",\""; print CSVF "$b_last"; print CSVF "\",\""; print CSVF "$b_addr"; print CSVF "\",\""; print CSVF "$b_addr2"; print CSVF "\",\""; print CSVF "$b_city"; print CSVF "\",\""; print CSVF "$b_state"; print CSVF "\",\""; print CSVF "$b_zip"; print CSVF "\",\""; print CSVF "$b_phone"; print CSVF "\",\""; print CSVF "$b_fax"; print CSVF "\",\""; print CSVF "$b_email"; print CSVF "\",\""; print CSVF "$s_first"; print CSVF "\",\""; print CSVF "$s_last"; print CSVF "\",\""; print CSVF "$s_addr"; print CSVF "\",\""; print CSVF "$s_addr2"; print CSVF "\",\""; print CSVF "$s_city"; print CSVF "\",\""; print CSVF "$s_state"; print CSVF "\",\""; print CSVF "$s_zip"; print CSVF "\",\""; print CSVF "$s_phone"; print CSVF "\",\""; print CSVF "$QUANTITY_1"; print CSVF "\",\""; print CSVF "\R$PRICE_1"; print CSVF "\",\""; print CSVF "$ID_1"; print CSVF "\",\""; print CSVF "$NAME_1"; print CSVF "\",\""; print CSVF "$ADDTLINFO_1"; print CSVF "\",\""; print CSVF "$QUANTITY_2"; print CSVF "\",\""; print CSVF "\R$PRICE_2"; print CSVF "\",\""; print CSVF "$ID_2"; print CSVF "\",\""; print CSVF "$NAME_2"; print CSVF "\",\""; print CSVF "$ADDTLINFO_2"; print CSVF "\",\""; print CSVF "$QUANTITY_3"; print CSVF "\",\""; print CSVF "\R$PRICE_3"; print CSVF "\",\""; print CSVF "$ID_3"; print CSVF "\",\""; print CSVF "$NAME_3"; print CSVF "\",\""; print CSVF "$ADDTLINFO_3"; print CSVF "\",\""; print CSVF "$QUANTITY_4"; print CSVF "\",\""; print CSVF "\R$PRICE_4"; print CSVF "\",\""; print CSVF "$ID_4"; print CSVF "\",\""; print CSVF "$NAME_4"; print CSVF "\",\""; print CSVF "$ADDTLINFO_4"; print CSVF "\",\""; print CSVF "$QUANTITY_5"; print CSVF "\",\""; print CSVF "\R$PRICE_5"; print CSVF "\",\""; print CSVF "$ID_5"; print CSVF "\",\""; print CSVF "$NAME_5"; print CSVF "\",\""; print CSVF "$ADDTLINFO_5"; print CSVF "\",\""; print CSVF "$QUANTITY_6"; print CSVF "\",\""; print CSVF "\R$PRICE_6"; print CSVF "\",\""; print CSVF "$ID_6"; print CSVF "\",\""; print CSVF "$NAME_6"; print CSVF "\",\""; print CSVF "$ADDTLINFO_6"; print CSVF "\",\""; print CSVF "$QUANTITY_7"; print CSVF "\",\""; print CSVF "\R$PRICE_7"; print CSVF "\",\""; print CSVF "$ID_7"; print CSVF "\",\""; print CSVF "$NAME_7"; print CSVF "\",\""; print CSVF "$ADDTLINFO_7"; print CSVF "\",\""; print CSVF "$QUANTITY_8"; print CSVF "\",\""; print CSVF "\R$PRICE_8"; print CSVF "\",\""; print CSVF "$ID_8"; print CSVF "\",\""; print CSVF "$NAME_8"; print CSVF "\",\""; print CSVF "$ADDTLINFO_8"; print CSVF "\",\""; print CSVF "$QUANTITY_9"; print CSVF "\",\""; print CSVF "\R$PRICE_9"; print CSVF "\",\""; print CSVF "$ID_9"; print CSVF "\",\""; print CSVF "$NAME_9"; print CSVF "\",\""; print CSVF "$ADDTLINFO_9"; print CSVF "\",\""; print CSVF "$QUANTITY_10"; print CSVF "\",\""; print CSVF "\R$PRICE_10"; print CSVF "\",\""; print CSVF "$ID_10"; print CSVF "\",\""; print CSVF "$NAME_10"; print CSVF "\",\""; print CSVF "$ADDTLINFO_10"; print CSVF "\",\""; print CSVF "$QUANTITY_11"; print CSVF "\",\""; print CSVF "\R$PRICE_11"; print CSVF "\",\""; print CSVF "$ID_11"; print CSVF "\",\""; print CSVF "$NAME_11"; print CSVF "\",\""; print CSVF "$ADDTLINFO_11"; print CSVF "\",\""; print CSVF "$QUANTITY_12"; print CSVF "\",\""; print CSVF "\R$PRICE_12"; print CSVF "\",\""; print CSVF "$ID_12"; print CSVF "\",\""; print CSVF "$NAME_12"; print CSVF "\",\""; print CSVF "$ADDTLINFO_12"; print CSVF "\",\""; print CSVF "$QUANTITY_13"; print CSVF "\",\""; print CSVF "\R$PRICE_13"; print CSVF "\",\""; print CSVF "$ID_13"; print CSVF "\",\""; print CSVF "$NAME_13"; print CSVF "\",\""; print CSVF "$ADDTLINFO_13"; print CSVF "\",\""; print CSVF "$SUBTOTAL"; print CSVF "\",\""; print CSVF "$TOTAL"; print CSVF "\",\""; print CSVF "$SHIPPING"; print CSVF "\",\""; print CSVF "$comment"; print CSVF "\"\n"; close CSVF; } # Send email conformation to the customer..... open (MAIL,"|$mailprogram"); print MAIL "To: $b_email\n"; print MAIL "From: $youremail\n"; print MAIL "Subject: Order Confirmation\n"; print MAIL "\n\n"; print MAIL "A new order has been received. A summary of this order appears below.\n"; print MAIL "\n"; print MAIL "Order Date: $months[$month] $day, $year $hour:$min:$sec \n"; print MAIL " \n"; print MAIL "Bill To: \n"; print MAIL "-------- \n"; print MAIL " $b_first $b_last \n"; print MAIL " $b_addr \n"; print MAIL " $b_addr2 \n"; print MAIL " $b_city, $b_state $b_zip \n"; print MAIL " $b_phone \n"; print MAIL " $b_fax \n"; print MAIL " $b_email \n"; print MAIL " \n"; print MAIL " \n"; print MAIL "-------- \n"; if ( $s_addr eq "" ) { print MAIL " Use Billing Address\n"; } else { print MAIL " $s_first $s_last \n"; print MAIL " $s_addr \n"; print MAIL " $s_addr2 \n"; print MAIL " $s_city, $s_state $s_zip \n"; print MAIL " $s_phone \n"; } print MAIL " \n"; print MAIL " \n"; print MAIL "Qty Price(\R) Product ID - Product Name\n"; print MAIL "===================================================================== \n"; print MAIL "$QUANTITY_1 \R$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n"; if( $NAME_2 ) {print MAIL "$QUANTITY_2 \R$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";} if( $NAME_3 ) {print MAIL "$QUANTITY_3 \R$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";} if( $NAME_4 ) {print MAIL "$QUANTITY_4 \R$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";} if( $NAME_5 ) {print MAIL "$QUANTITY_5 \R$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";} if( $NAME_6 ) {print MAIL "$QUANTITY_6 \R$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";} if( $NAME_7 ) {print MAIL "$QUANTITY_7 \R$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";} if( $NAME_8 ) {print MAIL "$QUANTITY_8 \R$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";} if( $NAME_9 ) {print MAIL "$QUANTITY_9 \R$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";} if( $NAME_10 ){print MAIL "$QUANTITY_10 \R$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";} if( $NAME_11 ){print MAIL "$QUANTITY_11 \R$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";} if( $NAME_12 ){print MAIL "$QUANTITY_12 \R$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";} if( $NAME_13 ){print MAIL "$QUANTITY_13 \R$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";} print MAIL "===================================================================== \n"; print MAIL "SUBTOTAL: $SUBTOTAL \n"; print MAIL "TOTAL: $TOTAL \n"; print MAIL "\n"; print MAIL "\n\n"; print MAIL "Comments: \n"; print MAIL "--------- \n"; print MAIL "$comment \n"; print MAIL " \n"; close MAIL; print "Content-type: text/html\n\n"; open (HEAD, $header); @LINES = <HEAD>; close HEAD; print @LINES; print "<h2>Thank you</h2>"; print "Thank you for your order."; print "Please contact us at $youremail if you have any problems questions or concerns. Thank U again for your support Kees Meyer."; print "<P>"; print "<A HREF=\"$returnpage\" rel="nofollow" target=_top>Return Home</A>"; print "<P>"; open (FOOT, $footer); @LINES = <FOOT>; close FOOT; print @LINES; exit; I am programatically trying to send multiple emails from within javascript code. I have read forums with different ideas and have not found a true solution. The problem I am having is as follows: - in one try - i am using window.location="mailto:"+emailList - this works great if it only needs to generate 1 email, but I am doing it in a loop. when it loops through the 2nd time, it does not create a 2nd email - in a 2nd try - i am using window.open("mailto:"+emailList - this does open multiple emails, but it also opens multiple windows. I am trying to find a way to either not have the windows open (only the multiple emails) or automatically close the extra windows. I am including my code below - note - the window.location try is listed, but commented out. Any help would be appreciated. if (emailListArray.length > jsNumEmails) { var j=1; for (var i=0; i<emailListArray.length; i++) { partialEmailList = partialEmailList + ";" + emailListArray[i]; if (j == jsNumEmails) { //window.location="mailto:"+partialEmailList; window.open("mailto:"+partialEmailList, "temp", "height=5, width=5, top=0, left=0"); j = 0; partialEmailList = ""; } //if j++; }//for } // if anything left in the partial list, then send that separately if (partialEmailList != "") { //window.location="mailto:"+partialEmailList; window.open("mailto:"+partialEmailList, "temp", "height=5, width=5, top=0, left=0"); } I am trying to give uses the ability to email a web page in addition to print the pages but I cannot get the web page to post as the body of the email. Here is what the print function looks like: Code: function OnPrint() { var contentWindow = GetContentFrame().contentWindow; { contentWindow.focus(); contentWindow.print(); } } and here is where I stand on the email the page(not just a link to the page) Code: function mailpage() { mail_str = "mailto:optilinksupport@seton.org?subject=Check out the " + document.title; mail_str += "&body=I thought you might be interested in the " + document.title; mail_str += ". You can view it at, " + location.href; location.href = mail_str; } The above work great if I want to send a link to the page. How do I amend the above so that the the mail_str = contentWindow html? And do I need to do make other changes to format the email as html rather than text? Thank for a rookie! I want to send a simple email with just email & subject only when the user clicks a link that opens a pdf. I'm thinking javascript is the best way to do this but I have no idea how. I have googled it a bunch but most information is about getting an email when someone clicks a link you send in an email. I don't want that. This is on a website. I'm not sure if php would be better to use. Any help would be most appreciated!
Is it possible to use JavaScript to send a HTML FORM this way? (By the way, this is a huge guess - I don't know JavaScript very well) Code: <SCRIPT type="text/javascript"> function Cart1Function() { get.INPUT.quantity.value send.to.formsubmit1.php } function Cart2Function() { get.INPUT.quantity.value send.to.formsubmit2.php } </SCRIPT> <FORM action="?" method="post" name="form"> <DIV> <INPUT type="text" name="quanitity"> <INPUT type="submit" value="CART 1" onClick="Cart1Function"> <INPUT type="submit" value="CART 2" onClick="Cart2Function"> <DIV> </FORM> I want to make two forms sharing the same input (quantity). I have a vista 32bit pc and whenever i try to install Visual c ++ 2008(WHICH I NEED) it always stops and says 1935error tokenkey something? What do i do to fix this I tried REFORMATTING MY ENTIRE PC 3 TIMES NOTHING IS WORKING PELASE HELP ME I am trying to write a translator box for my website. So far, I've been able to get working code from a tutorial: Code: <input id="ori" type="text" /> <button onclick="translate();">Translate</button> <div id="trans"></div> <script> var languageFrom = "en"; var languageTo = "fr"; function translate() { document.getElementById('trans').innerHTML="Translating... please wait"; var text= document.getElementById('ori').value; window.mycallback = function(response) { document.getElementById('trans').innerHTML=response; } var s = document.createElement("script"); s.src = "http://api.microsofttranslator.com/V2/Ajax.svc/Translate?oncomplete=mycallback&appId=<MY-APP-ID>&from=" + languageFrom + "&to=" + languageTo + "&text=" + text; document.getElementsByTagName("head")[0].appendChild(s); } </script> (Script it from he http://wizardsoweb.com/microsoftbing...itcher=desktop) Basically, once I fill in my APPID, it will translate the text in the ori text box to French. Of course, this all works fine, but here's what I'm trying to do: I want there to be two drop down menus. One will populate the languageFrom variable with a specified language, and another drop down menu which will populate the languageTo variable with a specified language. I've already posted about this matter in a different post: http://stackoverflow.com/questions/8...from-drop-down (It's on stackoverflow). That way, when you select a value from the drop down menu, it populates the variable. I have a working example of this on jsFiddle: http://jsfiddle.net/charlescarver/hk2bJ/1/ (This includes my working API key so I it's easy to work on) SO, I think the problem with this is that the script which controls the translation is loaded when the variables are empty, and then doesn't update when a drop down option is selected. I think this can be fixed by calling the script when the button is clicked, instead of when the page is loaded. How can this be accomplished? The Microsoft support is poorly documented and I can't find a solution there or on google. Here's a link to the API documentation: http://msdn.microsoft.com/en-us/library/ff512385.aspx Alright, so I've been writing a plain javascript file, which is called by HTML later to grab information from a certain page and then parse through that information. This is being done as a Windows Gadget, so the "browser" is IE. I have two main problems with this: One is caching. I can't get not caching to work at all. I've tried headers and I've tried putting something random at the end of the URL. The randomness at the end of the URL works when done from an HTML file embedded with Javascript but will not work from a pure Javascript file. My other, potentially bigger, problem is that the xmlhttp object does not seem to ever want to open again. I'm pretty sure what's happening is it doesn't get back into ready state 4. That is, unless I run an html file that accesses the same url. Then, suddenly, the gadget runs its update function and it actually decides to work. The gadget still runs the update function otherwise but it doesn't actually do anything, which is I believe caused by it never getting back to ready state 4 on its own. I appreciate any help on this, and if I didn't explain anything clearly I'm more than happy to clarify. Cheers. Hi everyone, I am new to web development. The company I am working for would like to develop a data analysis web interface. This interface would take information from a mySQL database from certain queries and then save the data into an array. After this the data would be exported to Microsoft Excel where a Chart would be created and then uploaded to the web interface. So far I have been able to store the mySQL data into an array but I have been having trouble trying to determine if you can in fact use javascript to tell Excel to create the chart. Any help would be greatly appreciated. I get "Microsoft JScript runtime error: '$' is undefined" with the javascript below. How should I troubleshoot this? <script type="text/javascript" language="javascript"> function ShowPopup() { $('#mask').show(); $('#<%=pnlpopup.ClientID %>').show(); } function HidePopup() { $('#mask').hide(); $('#<%=pnlpopup.ClientID %>').hide(); } $(".btnClose").live('click', function () { HidePopup(); }); </script> Hi, I'm creating a new email in javascript via outlook. When i try entering a line break "\n", "\r", "\r\r", etc, Outlook just ignores it completely. I've tried using "%0D%0A" and "fromCharCode(10)" as well but it doesnt seem to read it as a line break. Is there any way to code it so that a line break or a carriage return appears on outlook? I have a piece of javascript that attaches a PDF document to an outlook form. However the PDF that I am pulling has a default name such as 'test' and I would like to change it to say 'client.pdf'. Is this possible in the script below? var theApp = new ActiveXObject("Outlook.Application"); var theMailItem = theApp.CreateItem(0); theMailItem.to = "test@test.com" theMailItem.Subject = "test"; theMailItem.Attachments.add("http://someURL/test?abc.pdf"); It currently saves the attachment as 'test' instead of abc.pdf (i.e. it seems to pick up the text before the question mark). Anyway of changing/settign the name differently? Many thanks Hi, I am facing one problem when i am trying to open the outlook express through javascript. Here i am able to open the outlook express with all the data, but when i press enter on any line of the body if the message, it moves 2 lines. Can any body help me to make it to single spacing. The code i have used is given below. sendemail.js Quote: // JScript File function EmailIt(task,issue_id,emailTO,strTitle,strsubsystem,chkAvailableAll,ddlJob,ddlSystem,ddlTester,ddlPr iority,txtDueDate,ddlAssignedTo,ddlStatus) { //win = window.open("...\\Issues\\HTMLPage3.htm"); var daReferrer = document.referrer; //var task = escape(document.URLUnencoded); //var issue_id = document.URLUnencoded.split("="); var email = emailTO; var title = strTitle; var subsystem = strsubsystem; var availableall = chkAvailableAll; var CustomerJob = ddlJob; var System = ddlSystem; var DueDate = txtDueDate; var AssignedTo = ddlAssignedTo; var Priority = ddlPriority; var Tester = ddlTester; var Status = ddlStatus; var subject = "Issue Task number is " + issue_id + " - " + escape(title) ; var body_message = " Your Assigned Task is.%0D " + escape(task); //+ escape("\n") + " :subsystem ===>"+ subsystem + escape("\n") + " :title ===>" + title + escape("\n") + "available all ===>" +availableall; body_message += escape("\n"); body_message += escape("\n"); body_message += " Customer/Job : " + escape(CustomerJob); body_message += escape("\n"); body_message += " Available For All : " + escape(availableall); body_message += escape("\n"); body_message += " System : " + escape(System); body_message += escape("\n"); body_message += " Sub System : " + escape(subsystem); body_message += escape("\n"); body_message += " Title : " + escape(title); body_message += escape("\n"); body_message += " DueDate : " + escape(DueDate); body_message += escape("\n"); body_message += " AssignedTo : " + escape(AssignedTo); body_message += escape("\n"); body_message += " Priority : " + escape(Priority); body_message += escape("\n"); body_message += " Tester : " + escape(Tester); body_message += escape("\n"); body_message += " Status : " + escape(Status); body_message += escape("\n"); //alert("body_message:--> " + body_message); var mailto_link = 'mailto:'+email+'?subject='+subject+'&body='+body_message; //alert("mailto_link: " + mailto_link); win = window.open(mailto_link); if (win && win.open &&!win.closed) win.close(); //window.history.back(-1); } Can any body please help me to come out this problem. Regards, Vimal kumar srivastava Madhepura,India Hi I am trying to load html stream directly into webbrowser in delphi. The html contains java script. It loads xml and xsl files and display the xml content in the web browser. I got an error, says access denied for the command xmlDoc.load(fname); If I save the html into a file, test.html, and double click it, it is fine, no problem. The code is actually copied from w3schools.com. the html code as followed: <html> <head> <script> function loadXMLDoc(fname){var xmlDoc; if (window.ActiveXObject) { xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); } else { alert('Your browser cannot handle this script'); } xmlDoc.async=false; xmlDoc.load(fname); return(xmlDoc); } function displayResult() { xml=loadXMLDoc("catalog.xml"); xsl=loadXMLDoc("catalog.xsl"); if (window.ActiveXObject) { ex=xml.transformNode(xsl); document.getElementById("example").innerHTML=ex; } } </script> </head> <body id="example" onLoad="displayResult()"> </body> </html> The delphi code is procedure TForm1.WBLoadHTML(WebBrowser: TWebBrowser; HTMLCode: string) ; var v: OleVariant; HTMLDocument: IHTMLDocument2; begin memo1.Lines.LoadFromFile('d:\test\htmltxtold.html'); HTMLCode := memo1.Text; WebBrowser1.Navigate('about:blank') ; HTMLDocument := WebBrowser.Document as IHTMLDocument2; v := VarArrayCreate([0, 0], varVariant); v[0] := HTMLCode; HTMLDocument.Write(PSafeArray(TVarData(v).VArray)); HTMLDocument.Close; end; Thanks a lot Hi guys. I'm a mediocre website designer i know html , at JS i'm to noob to actualy make something of my own just Edit, i'm still learning and atm i'm working on a web project and I'm struggling to find a way to Filter email addresses to redirect my New Members to their e-mail provider, for example if they would register newmmember@hotmail.com to be forwarded to www.hotmail.com so they would login and activate their account, or if they enter @yahoo.com to be forwarded there . Can you please point out a few things i'm eager to learn how to Forward User to email provider after he creates his account . Or how can i forward email to URL inside my webpage , this could help me with another ideea i have, again this would have to be filtered @yahoo.com , @hotmail.com etc , to be forwarded to a local URL inside the site depending on what Email Provider they enter . I know this is a lot to ask but if you could point me out on the right path i would really appreciate all your help . Cheers
Can I send a key stroke to effectively click the back button? Cheers Daniel. |