// EMAIL // Autosuggest defaults _e.email_as_field = 'email_id'; _e.email_as_dt = 'Contact'; _e.email_as_in = 'email_id,contact_name'; sendmail = function(emailto, emailfrom, cc, subject, message, fmt, with_attachments) { var fn = function(html) { $c('webnotes.utils.email_lib.send_form', { 'sendto':emailto, 'sendfrom': emailfrom?emailfrom:'', 'cc':cc?cc:'', 'subject':subject, 'message':replace_newlines(message), 'body':html, 'full_domain': wn.urllib.get_base_url(), 'with_attachments':with_attachments ? 1 : 0, 'dt':cur_frm.doctype, 'dn':cur_frm.docname }, function(r, rtxt) { // } ); } // build print format _p.build(fmt, fn); } _e.make = function() { var d = new Dialog(440, 440, "Send Email"); var email_go = function() { var emailfrom = d.widgets['From'].value; var emailto = d.widgets['To'].value; if(!emailfrom) emailfrom = user_email; // validate email ids var email_list = emailto.split(/[,|;]/); var valid = 1; for(var i=0;i