Tuesday, June 4, 2019

Send Email with Body HTML Unformatted Content

When using nlapiSendEmail(author, recipient, subject, body, cc, bcc, records, attachments, notifySenderOnBounce, internalOnly, replyTo) function, the body parameter is formatted with HTML tags. This may be not desired in case of a user needs to keep the same body content as on input (non-HTML formatted).The solution to pass the body content unformatted is to send it as an attachment (one of the parameters of the nlapiSendEmail() function);

Example:A user needs to pass XML content to email client, where the XML is processed.

var xml = "";// XML Headerxml += '';xml += '';// Header xml += ''; xml += '  Date Created '; xml += '  Name '; xml += '  Phone '; xml += '  Fax '; xml += '  Email address '; xml += '';// Contents xml += '';xml += ' 10/10/2013';xml += ' Sample Record';xml += ' 123456789';xml += ' 123456799';xml += ' sample@sample.com';xml += '';// Close documentxml += '';// Create File Attachment var file = nlapiCreateFile('searchresults.xml', 'XMLDOC', xml);// Send the XML file via emailvar newEmail = nlapiSendEmail(-5, 'admin@sample.com', 'Sample XML Email','Please see the attached file', null, null, null, file);

5 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. I as of late ran over your website and have been perusing along. I thought I would leave my first remark. I don't realize what to say aside from that I have delighted in perusing. Decent blog. I will continue going to this online journal frequently. How to remove negative content online

    ReplyDelete
  3. I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. Vancouver SEO Agency

    ReplyDelete
  4. We have sell some products of different custom boxes.it is very useful and very low price please visits this site thanks and please share this post with your friends. send fax from phone android

    ReplyDelete
  5. Admiring the time and effort you put into your blog and detailed information you offer!.. get response pricing

    ReplyDelete