JavaScript - Mail Service
Dear Sir,
I have designed a mail service in java.In my compose page,i want to attach some excel files of text files and to send it.After sending i want to store it my database.Then how can i download or open that file after opening that recipient mail inbox. Regards Debasis Similar TutorialsHi In C# I would attach the service reference http://www.anotherdomain.com/Service1.svc?wsdl then write myService MS = new myservice(); string[] s = MS.GetDates(); //return an array of string dates BUT can this be done with only Javascript/Jquery , where the service is on a different domain? Can you please tell me how or point me in the right direction Thanks for the help Hello, I am writing a simple yahoo widget that consumes a web service. I tried by using soapclient.js Here is the code: Code: <action trigger="onLoad"> <!-- <text> <name>txtGroups</name> <color>#FFFFFF</color> <size>20</size> <vOffset>100</vOffset> <hOffset>150</hOffset> </text> include("soapclient.js"); mainWindow.visible = true; function getOffices() { var pl = new SOAPClientParameters(); pl.add("userId", preferences.User.value); pl.add("pwd", preferences.Password.value); SOAPClient.invoke("host:port/ReturnOffices/Config1?wsdl", "getOffices", pl, true, getOffices_callBack); } function getOffices_callBack(r) { txtGroups.data=r; } getOffices(); --> </action> I get error: Code: Your browser does not support XmlHttp Objects soapclient.js line 360 Can anybody please let me know what is the correct way to call a web service in javascript (onLoad)... Thanks Srinivas Hey all, I'm playing with a greasemonkey script and would like to provide geo-locating. The geolocation services I've found all require dev/api-key. A dev-key means I reveal my well-earned key, or an api-key usually means a server address... there would be none via a greasemonkey script. Any ideas for gathering geolocation services? Any links, tips, ideas welcome! i have a web service at this url http://196.218.16.133/onlinereservat...p=HotelsSearch i use hotel search file with HotelSearch method and method will retrieve xml file contains the matched data. the varialbe that i made post with it is named : HotelData the data of the variable is a string file that contains an xml data like this Code: <HotelsParameters> <CityID>388</CityID> <UserName>admin</UserName> <UserPassword>admin</UserPassword> <DateFrom>4/12/2010</DateFrom> <DateTo>4/13/2010</DateTo> <NumberOfRooms>2</NumberOfRooms> <Room> <RoomSerial>1</RoomSerial> <Adults>1</Adults> <Child> <ChildSerial>1</ChildSerial> <ChildAge>5</ChildAge> </Child> </Room> <Room> <RoomSerial>2</RoomSerial> <Adults>2</Adults> <Child> <ChildSerial>1</ChildSerial> <ChildAge>8</ChildAge> </Child> </Room> <Room> <RoomSerial>3</RoomSerial> <Adults>3</Adults> <Child> </Child> </Room> <CurrencyID>162</CurrencyID> </HotelsParameters> i am trying to get the result by posting HotelData but i did not get the xml result file so can anyone help me my code is: Code: <script language="JavaScript"> function InitializeService() { service.useService("http://196.218.16.133/onlinereservation/service.asmx?WSDL", "HotelsSearch"); } var StrSearch; function GetAge() { StrSearch = document.DemoForm.StringSearch.value; service.HotelsSearchService.callService("HotelsSearch", StrYear); } function ShowResult() { alert(event.result.value); } </script> <form name="DemoForm"> Hotel Name : <input type="text" name="HotelData"/><br /> <button onclick="GetAge()">Get Age</button><br /> </form> the data in input filed is the previous xml file I have 3 Qs about ajax(1,2) and syntax meaning(3): 1- I want to appear a list of urls from a db table to browser, with their newest Google PAGE RANK every time appear in the webpage, and this rank saved auto to database along with previous.... google provides any web service for this? tell me URLs? I found difficulty contact google... 2- Do you know any internet web service (programming) that you input a Russian word, and get (true or 1) if valid, or (false or 0) if not valid word? 3- what mean the in file attached statements to html main file? script.js?x=5 or style.css?p=5 or xmlfile.xml?x=777. I was wondering if its possible to have javascript stop a service on my machine for instance terminal services and then start it again...Any help provided will be greatly appreciated
Hello javascript experts... I am following this blog on calling web service in javascript. I am getting syntax error, in my javascript... Code: <action trigger="onLoad"> <!-- mainWindow.visible = true; <script type="text/javascript" src="prototype.js"></script> <script type="text/javascript" src="ws.js"></script> <script type="text/javascript"> function getSalesXml(name, container) { var call = new WS.Call('<url to the wsdl>'); var nsuri = 'http://example'; var qn_op = new WS.QName('<functionName>',nsuri); var qn_op_resp = new WS.QName('sayHelloResponse',nsuri); call.invoke_rpc( qn_op, new Array( {name:'userId',value:<user>} {name:'pwd',value:<password>} ),null, function(call,envelope) { var ret = envelope.get_body().get_all_children()[0]. get_all_children()[0].get_value(); container.innerHTML = ret; $('soap').innerHTML = arguments[2].escapeHTML(); } ); } </script> --> </action> at line: Code: src="ws.js"></script> Can anybody correct this error..., Hi, I am writing JavaScript code that runs inside HTTP page, I need to make XMLHttpRequest to a REST web service. The service is running on the same site but it only accepts HTTPS. I tried to prefix the URL with https:// and Firefox rejected it as cross-site scripting attempt. It's not really cross site as I am calling the same site. I don't have an option to redirect the entire page to https. Is there a proper way to implement this request? Sergey p.s. (sorry if this is a dumb question, I am a JavaScript newbie) Hi I'm New to javascript how to Call WCF service using Javascript or Jquery in html page.(with out using Activex Objects) Hi, I'm using javascript in addition to a web service (BTBuckets) to display different content to visitors based on actions they take on my site. The javascript is working fine, but I noticed that if I simulate BTBuckets being disabled using Firefox Adblock none of the content shows up. So in the off chance of the service going offline it'll leave some pretty funky holes in the my content. I tried <noscript> tags which works with javascript off, but the content is still blank when I disable BTBuckets. I'm wondering if there's a way to display the default content if the service is unavailable? Here's the code I'm using: In the head: Code: <script type="text/javascript"> //<![CDATA[[ $BTB={s:XXXXX}; $BTB.jsh="http://static.btbuckets.com/bt.js"; //]]> </script> <script type="text/javascript"> document.write(unescape("%3Cscript src='" + $BTB.jsh.replace(/(https?:)/i,document.location.protocol) + "' type='text/javascript'%3E%3C/script%3E")); </script> The code in the body used to replace an image depending on visitor behavior: Code: <script type="text/javascript"> var _t = ""; if ($BTB.clusters["ppc_visitors"]) { _t = "\"images/top-photo-tracking-number.jpg\" alt=\"Call Toll-Free: 1-800-XXX-XXXX\">"; } else { _t = "\"images/top-photo.jpg\" alt=\"Call Toll-Free: 1-800-XXX-XXXX\">"; } document.write('<img src= ' + _t ); </script> <noscript><img src="images/top-photo.jpg" alt="Call Toll-Free: 1-800-XXX-XXXX"></noscript> 0 down vote favorite I have been struggling with this for some time.. I searched around but didnt get a solution yet. This is only an issue on production server. In my development environment, everything works just fine. I am using JQuery/Ajax to update product information based on product's Color attribute. for example, a product has A and B color, the price for color A is different from color B. When user choose different color, the price information is updated as well. What I did is to first add a javascript function: function updateProductVariant() { var myval = jQuery("#<%=colorDropDownList.ClientID%>").val(); jQuery.ajax({ type: "POST", url: "/Products.aspx/GetVariantInfoById", data: "{variantId:'" + myval + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { var obj = jQuery.parseJSON(response.d); jQuery("#<%=lblStockAvailablity.ClientID%>").text(obj.StockMessage); jQuery(".price .productPrice").text(obj.CurrentPrice); jQuery(".price .oldProductPrice").text(obj.OldPrice); } }); } Then I can register the dropdown list's 'onclick' event point to function 'updateProductVariant' GetVariantInfoById is a Web method in the codebehind, its also very straightforward: [WebMethod] public static string GetVariantInfoById(string variantId) { int id = Convert.ToInt32(variantId); ProductVariant productVariant = IoC.Resolve<IProductService>().GetProductVariantById(id); string stockMessage = productVariant.FormatStockMessage(); StringBuilder oBuilder = new StringBuilder(); oBuilder.Append("{"); oBuilder.AppendFormat(@"""{0}"":""{1}"",", "StockMessage", stockMessage); oBuilder.AppendFormat(@"""{0}"":""{1}"",", "OldPrice", PriceHelper.FormatPrice(productVariant.OldPrice)); oBuilder.AppendFormat(@"""{0}"":""{1}""", "CurrentPrice", PriceHelper.FormatPrice(productVariant.Price)); oBuilder.Append("}"); return oBuilder.ToString(); } All these works fine on my local box, but if i upload to the production server, catching the traffic using fiddler, /Products.aspx/GetVariantInfoById becomes a 302 Object moved Object moved to here. On my local box, HTTP/1.1 200 OK Server: ASP.NET Development Server/10.0.0.0 Date: Thu, 03 Mar 2011 09:00:08 GMT X-AspNet-Version: 4.0.30319 Cache-Control: private, max-age=0 Content-Type: application/json; charset=utf-8 Content-Length: 117 Connection: Close But when deployed on the host, it becomes HTTP/1.1 302 Found Proxy-Connection: Keep-Alive Connection: Keep-Alive Content-Length: 186 Via: 1.1 ADV-TMG-01 Date: Thu, 03 Mar 2011 08:59:12 GMT Location: http://www.pocomaru.com/Products.asp...d/default.aspx Server: Microsoft-IIS/7.0 X-Powered-By: ASP.NET then of course, then it returns 500 error title>Unknown web method GetVariantInfoById/default.aspx. Parameter name: methodName Can someone please take a look? I think its some configuration in the production server which automatically redirects my webservice call to some other URL, but since the product server is out of my control, i am seeking a local fix for this. Thanks for the help! Hey guys I found this Mail form online but its missing the mail to portion anyone able to help figure this out please. That would be appreciated. Code: <script type="text/javascript"> v_fields = new Array('sender_name','sender_email','sender_subject','sender_message');alert_on = true;thanks_on = true; thanks_message = "Thank you. Your message has been sent."; function validateForm(){ //alert(v_fields); //init errors var err = ""; //start checking fields for(i=0;i<v_fields.length;i++){ //store the field value var _thisfield = eval("document.contact."+v_fields[i]+".value"); //check the field value if(v_fields[i] == "sender_name"){ if(!isAlpha(_thisfield)){ err += "Please enter a valid name\n";} }else if(v_fields[i] == "sender_subject"){ if(!isAlpha(_thisfield)){ err += "Please enter a valid subject\n";} }else if(v_fields[i] == "sender_email"){ if(!isEmail(_thisfield)){ err += "Please enter a valid email address\n";} }else if(v_fields[i] == "sender_url"){ if(!isURL(_thisfield)){ err += "Please enter a valid URL\n";} }else if(v_fields[i] == "sender_phone"){ if(!isPhone(_thisfield)){ err += "Please enter a valid phone number\n";} }else if(v_fields[i] == "sender_message"){ if(!isText(_thisfield)){ err += "Please enter a valid message\n";} } }//end for if(err != ""){ if(alert_on){ alert("The following errors have occurred\n"+err); }else{ showErrors(err); } return false; } return true; } //function to show errors in HTML function showErrors(str){ var err = str.replace(/\n/g,"<br />"); document.getElementById("form_errors").innerHTML = err; document.getElementById("form_errors").style.display = "block"; } //function to show thank you message in HTML function showThanks(str){ var tym = str.replace(/\n/g,"<br />"); document.getElementById("form_thanks").innerHTML = tym; document.getElementById("form_thanks").style.display = "block"; } function isEmail(str){ if(str == "") return false; var regex = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i return regex.test(str); } function isText(str){ if(str == "") return false; return true; } function isURL(str){ var regex = /[a-zA-Z0-9\.\/:]+/ return regex.test(str); } // returns true if the number is formatted in the following ways: // (000)000-0000, (000) 000-0000, 000-000-0000, 000.000.0000, 000 000 0000, 0000000000 function isPhone(str){ var regex = /^\(?[2-9]\d{2}[\)\.-]?\s?\d{3}[\s\.-]?\d{4}$/ return regex.test(str); } // returns true if the string contains A-Z, a-z or 0-9 or . or # only function isAddress(str){ var regex = /[^a-zA-Z0-9\#\.]/g if (regex.test(str)) return true; return false; } // returns true if the string is 5 digits function isZip(str){ var regex = /\d{5,}/; if(regex.test(str)) return true; return false; } // returns true if the string contains A-Z or a-z only function isAlpha(str){ var regex = /[a-zA-Z]/g if (regex.test(str)) return true; return false; } // returns true if the string contains A-Z or a-z or 0-9 only function isAlphaNumeric(str){ var regex = /[^a-zA-Z0-9]/g if (regex.test(str)) return false; return true; } </script> Hi guys, I recently bought a template for a site that has a mail form. But I can't seem to figure out where I'm supposed to put my e-mail address so that I receive the e-mails. The code below is the only file associated with the e-mail form that came with the template. It calls on a mail.php file; do I need to create that file? If so, what do I put in that file? Is there somewhere in this script where I should put my e-mail address? I'm a total newbie with this stuff (obviously). But I would be sooo grateful for any help. Code: function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); return pattern.test(emailAddress); } /*FORM validation and div changing*/ $(document).ready(function() { /*email validatin*/ $("#submit").click(function() { var email = $("input#email").val(); if(!isValidEmailAddress(emailAddress)){ $("input#email").focus(); $("input#email").val('Enter a valid e-mail!'); return false; } }) /*form submit*/ $("form#contactForm").submit(function() { var email = $("input#email").val(); $.ajax({ url:'mail.php', type:'post', data: "email="+email, success: function(msg){ if (msg==0) { $("input#email").focus(); $("input#email").val('Some trouble on sending!'); } if (msg==1) { $("input#email").val('Thank you!'); } } }); return false; }); /*end formsubmit*/ }); Hello Everyone. And thank you for your help in advance. The code below is a basic HTML form that utilizes some javascript validation and CSS styling. It checks to see if the textbox field Is EMPTY. If it is an alert box appears displaying a message that the e-mail field is BLANK. In addition, the empty text box field is outlined in RED. That is great but I ALSO require it to perform some e-mail validation (i.e.) if an incorrect e-mail address is entered an alert box is displayed notifying the user of the error and outlining the text-box yet again. Any and ALL help would be nice. "Thank you." <html> <head> <title>Validation</title> <style type="text/css"> .inpBox { background-color: #FFFFFF; border: solid 2px #666666; } .inpBoxError { border: solid 4px #FF0000; } </style> <script type="text/javascript"> function verify_login(form_id,email) { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; var login_email = document.getElementById("email"); var msg = ""; if (login_email.value == "") { msg+= "Email address field cannot be left BLANK \n"; login_email.className = "inpBoxError"; } if (msg == "") { return true; } else { alert(msg); return false; } } </script> </head> <hody> <form id="form_id" method="POST" action="" onSubmit="return verify_login(form_id,email);"> <table border="1" width="30%"> <tr> <td width="15%"><div align="right"><b>E-Mail:</b></td> <td width="15%"><div align="left"><input id="email" name="email" type="text"></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><div align="center"><input id="submit" name="submit" type="submit" value="Register"></div></td> </tr> <table> </form> </hody> </html> Pardon me for asking a basic question. I basically need a pointer to an example or ways to learn this -- including an editor I should use for scripting. I would like to do the following: Divide a window into 3 panes; Display & manage messages in one pane; Each message has a unique subject line; Each message can be opened or deleted or forwarded. Thanks. I'm attempting to integrate a rich-text mail form and use PHPMailer to send HTML email to a Godaddy email account. The rich-text editor script is the WizzyWig one. (Original can be found Here) Location of form: http://www.westmichiganconcerts.com/contact.html Too much code to post here from all the different files involved, so I saved a version of each file as a TXT file, with it's original extention in brackets before it for easier code viewing (with the exception of the contact.html file above: Involved files: [.js]Rich-Text Editor: /scripts/whizzywig_61.txt [.js]File that spawns preview window: /scripts/load.txt [.php]File called by form action: test_mail.txt [.php]PHPMailer: /lib/PHPMailer_v5.1/class.phpmailer.txt [.php]Config file: /config.txt [.inc]Include file: MailClass.inc.txt Basic flow is: Customer goes to the Contact Page, then enters in rich text, and clicks "Preview" - this spawns a new window "DEMO" and writes the contents of the WizzyWig Iframe to a hidden field. From there, the customer can click "Submit", and it send the email to a Godaddy email account. Here's the problem: I've got a .replace command in the load.js file that replaces the double quotes with singles. If left as doubles, it completely breaks the code. When that email is received, all single quotes are backslashed(escaped?) ( \') so only portions of the HTML (that don't use quotes) show up. (examples: Highlight, insert image, insert link, spans, etc) I'm not fluent with Javascript, so I've been beating my head against the wall for 5 days now trying to get this to work. It's time to ask for some help lol. I'm not sure where / and in what file is causing this to break. Sent a test HTML email to the same Godaddy email address to make sure it could recieve HTML emails, and it worked fine. Any help would greatly be appreciated!! ~ John P.S.: I know there's browser issues with FF etc - I'll correct that once I can get the basic functionality of the pages to work I'm trying to setup a mail merge using a gmail docs script from http://www.labnol.org/software/mail-...h-gmail/13289/. So far, it works pretty well, but I want to edit it to include the following: 1) The script should start with "Dear Noah" as opposed to "Dear Noah_Kaplan" 2) I want to add my canned response to the script so that it always appears at the bottom of the e-mail. 3) Lastly, I want the outgoing mail to be saved as individual drafts in my drafts folder in gmail before it's sent out. That way, I can decide if I want to add a sentence or two to personalize each individual email draft. Thanks in advance for your awesome help. Best, Noah By the way, here's the script I want to edit: function onOpen() { var mySheet = SpreadsheetApp.getActiveSpreadsheet(); var menuEntries = [ {name: "Step 1: Import Gmail Contacts", functionName: "importContacts"}, {name: "Step 2: Start Mail Merge", functionName: "sendEmail"}, {name: "Help / About", functionName: "showHelp"}]; mySheet.addMenu("Mail Merge", menuEntries); } function importContacts() { var groupName = Browser.inputBox("Enter the name of your Gmail Contacts group he "); var mySheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var myContacts = ContactsApp.findContactGroup(groupName).getContacts(); for (i=0; i < myContacts.length; i++) { var myContact = [[myContacts[i].getFullName(), myContacts[i].getPrimaryEmail(), "Pending"]]; mySheet.getRange(i+2, 1,1,3).setValues(myContact); } Browser.msgBox("You have successfully imported " + myContacts.length + " contacts from Gmail. Please proceed to Step 3."); } function sendEmail() { var mySheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var newLine = "<br><br>"; var emailSubject = mySheet.getRange("F2").getValue(); var emailSalutation = mySheet.getRange("F3").getValue(); var emailLine1 = mySheet.getRange("F4").getValue() + newLine; var emailLine2 = mySheet.getRange("F5").getValue()? mySheet.getRange("F5").getValue() + newLine : ""; var emailLine3 = mySheet.getRange("F6").getValue()? mySheet.getRange("F6").getValue() + newLine : ""; var emailLine4 = mySheet.getRange("F7").getValue()? mySheet.getRange("F7").getValue() + newLine : ""; var emailLine5 = mySheet.getRange("F8").getValue()? mySheet.getRange("F8").getValue() + newLine : ""; var emailBody = emailLine1 + emailLine2 + emailLine3 + emailLine4 + emailLine5; var emailSignature = mySheet.getRange("F9").getValue() + newLine; var emailYourName = mySheet.getRange("F10").getValue(); emailBody = emailBody + emailSignature + emailYourName + "<br>"; var emailReplyTo = mySheet.getRange("F11").getValue(); var myContacts = mySheet.getDataRange(); var myContact = myContacts.getValues(); for (i=1; i < myContact.length; i++) { var person = myContact[i]; if (person[1] != "" && person[2] != "OK") { var emailMsg = emailSalutation + " " + person[0] + "," + newLine + emailBody; var advancedArgs = {htmlBody:emailMsg, name:emailYourName, replyTo:emailReplyTo}; MailApp.sendEmail(person[1], emailSubject, emailMsg , advancedArgs); mySheet.getRange(i+1,3).setValue("OK"); } } SpreadsheetApp.flush(); } function showHelp() { Browser.msgBox("With Mail Merge, you can send personalized email messages to your Gmail contacts in two easy steps. For help, visit http://labnol.org/?p=13289 or send me a tweet @labnol."); } Hi guys, having a problem with my javascript code... I need it to check that the name, email and message field have been filled out (which currently works fine) but also to check that the email is a valid address. This is my attempt at doing this, it works with the fields not being filled out, but does check that the email is valid? Any help appreciated. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html/javascript; charset=iso-8859-1"> <script type="text/javascript" language="JavaScript"> var FormName = "theForm"; var RequiredFields = "name, email, message"; function ValidateRequiredFields() { var FieldList = RequiredFields.split(",") var BadList = new Array(); for(var i = 0; i < FieldList.length; i++) { var s = eval('document.' + FormName + '.' + FieldList[i] + '.value'); s = StripSpacesFromEnds(s); if(s.length < 1) { BadList.push(FieldList[i]); } } if(BadList.length < 1) { return true; } var ess = new String(); if(BadList.length > 1) { ess = 's'; } var message = new String('\n\nThe following field' + ess + ' are required:\n'); for(var i = 0; i < BadList.length; i++) { message += '\n' + BadList[i]; } alert(message); return false; } function StripSpacesFromEnds(s) { while((s.indexOf(' ',0) == 0) && (s.length> 1)) { s = s.substring(1,s.length); } while((s.lastIndexOf(' ') == (s.length - 1)) && (s.length> 1)) { s = s.substring(0,(s.length - 1)); } if((s.indexOf(' ',0) == 0) && (s.length == 1)) { s = ''; } return s; } function validate_email(field,alerttxt) { with (field) { apos=value.indexOf("@"); dotpos=value.lastIndexOf("."); if (apos<1||dotpos-apos<2) {alert(alerttxt);return false;} else {return true;} } } function validate_form(thisform) { with (thisform) { if (validate_email(email,"Not a valid e-mail address!")==false) {email.focus();return false;} } } /*I found this javascript from http://www.willmaster.com/library/manage-forms/making-form-fields-required.php and customized it so it works with the fields on my page. I tried using the w3schools code but found that I could only make one field validate at a time, I had trouble making multiple fields validate at once so looked at different websites and found this one works with the fields - name, email and message.*/ </script> <link rel="stylesheet" type="text/css" href="charity.css" > <title>Charity form</title> </head> <body> <div id="mainContentArea"> <div id="contentBox"> <div id="title">The 'MAA'</div> <div id="linkGroup"> <div class="link"><a href="charity.htm">Home</a></div> <div class="link"><a href="pictures.htm">Images</a></div> <div class="link"><a href="links.htm">Links</a></div> <div class="link"><a href="enquiry.htm">Contact</a></div> </div> <div id="blueBox"> <div id="header"></div> <div class="contentTitle">Contact Marmite Addicts Anonymous</div> <div class="pageContent"> <form name="theForm" onsubmit="return ValidateRequiredFields(); return validate_form(this)" method="post" action="charityFormMail.php"> <b>*Enter your name:</b><br> <input type="text" name="name" value="" size="20"><br> <b>*Enter your email:</b><br> <input type="text" name="email" value="" size="20"><br> <b>*Enter your message:</b><br> <textarea name="message" rows="5" cols="20"> </textarea><br> <b>Your age:</b><br> <select name="Age"> <option value="0-20">0-20</option> <option value="21-30">21-30</option> <option value="31-40">31-40</option> <option value="41-50">41-50</option> <option value="51-60">51-60</option> <option value="60+">60+</option> </select> <br><br> <b>Gender:</b><br> <input type="radio" name="sex" value="male" /> Male <input type="radio" name="sex" value="female" /> Female<br><br> <b>How do you like your marmite?:</b><br> <input type="checkbox" name="check" value="On toast. "> On toast! <input type="checkbox" name="check1" value="In spaghetti. "> In spaghetti! <input type="checkbox" name="check2" value="On everything. "> On everything! <input type="checkbox" name="check3" value="Other"> Other... <br><br> <center> <div align="center" class="submit"> <input type="submit" value="Send" alt="send"> <input type="reset" value="Reset" alt="clear"> </div> </center> </form> <br> </div> </div> </div> </div> <br> </body> </html> 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 Hi All- I've read the posting stickies but really don't know where to post this question, have pity I'm a newbe. Please move the post if necessary. I was given this "Mail To:" script from someone off some forum. I believe it is a secure format and managed to insert my info and it does work. I had my code verified by W3C. Yet, I think it has lines which could be deleted, I don't understand the comment out code as written in as ( // ) ? I especially don't understand the "<\/a>" at the end of this line: str += "'>" + anchortext + "<\/a>"; What is str? var? I'm tying to clean it up and understand it. Thanks for your comments. Like I say, it does work as stands. I've placed an[*] where I have inserted my info. <script type="text/javascript" language="JavaScript"> //<![CDATA[ var anchortext = "Email"; * var mailpart1 = "eci"; * var mailpart2 = "ecicare.com"; * var subject = 'ECI Website Inquiry'; * //var body = 'Set body of email'; // could add a set BODY like this (comment out if not needed) var str = "<a href='" + "mail" + "to:"; str += mailpart1 + "@" + mailpart2; str += "?subject="+subject; //str += "&body="+body; // also comment out this line if not needed str += "'>" + anchortext + "<\/a>"; document.write(str); //--> //]]> </script> Later, Robes |