Home > Domino Tips > Developer > HTML > Programmatically create HTML e-mails
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

HTML

Programmatically create HTML e-mails


Angie Schottmuller
02.26.2004
Rating: -4.59- (out of 5) Hall of fame tip of the month winner


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


View member feedback to this tip.

Editor's Note: This tip only works in ND6. This code uses the NotesMIMEEntity class, so it only works with Release 5.0.2 and above.

Have you wondered how e-marketing campaigns create those swanky advertisements using HTML? Some folks think the only way to do that in Notes is to store the form in the document or insert a bunch of images. However, that cannot be done programmatically, and stored forms and images make for large file sizes. Here's how you can create awesome HTML e-mails in Notes by rending the message body as MIME instead of Rich Text.

Code

Copy the following code into a LotusScript agent. Be sure to change the sendto or the e-mail will go to me. Run the agent and see how the HTML appears. Update the code as needed. When I use the code I create subs for writing the stylesheet and all the content. Have fun!

MEMBER FEEDBACK TO THIS TIP

Very good find, it's just what I was looking for, but it doesn't work on R5. The NotesMIMEEntry class doesn't exist in R5.

-- Alain G.

****************************************************

This is much better solution for R6 than the quirky work-arounds that were necessary in R5. I have always preferred HTML to Rich Text formatting. This tip makes it easy. Great tip!

-- Chris C.

****************************************************

Excellent tip! I've been looking at HTML e-mails and you just saved me quite a bit of trouble.

-- Paul M.

***************************************...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
HTML
Create a dynamic fluid image gallery with Lotus Notes views
Write HTML and JavaScript in Notes view rows and columns on the Web
Open Lotus Notes documents in Microsoft Word without coding
Trap an attachment path via the Domino file upload control field
A bevy of Notes/Domino development tips
Styling Lotus Domino Web fields
How to convert Microsoft Word or Microsoft Excel documents to HTML
An easier way to view multiple columns on the Web
How to print a form in landscape format automatically
Tip contest winner: Hide view column while being able to sort it

HTML for Lotus Notes Domino
Create a dynamic fluid image gallery with Lotus Notes views
Write HTML and JavaScript in Notes view rows and columns on the Web
Open Lotus Notes documents in Microsoft Word without coding
Top 10 Lotus Notes/Domino coding and development tips of 2008
Trap an attachment path via the Domino file upload control field
Mimic Lotus Notes Domino application functionality on the Web
Top 10 Lotus Notes Domino programming and development tips of 2007
Creating a link on an HTML page to a Microsoft Word attachment in a Lotus Notes database
A bevy of Notes/Domino development tips
Top 10 Notes/Domino developer tips of 2006

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


*************

Angie, you must have been listening to my last conversation! I now have a REAL reason to upgrade to ND6+. Works like a dream.

--Ralph R.

****************************************************

In this tip Angie has this line: I did a Google search and did not find any information on this. Is this a standard to prevent out of office agents from sending an e-mail?

Also, I send out HTML e-mails by creating a database that has "control" documents. In my LotusScript agent I copy the body of the control document (which has the message I want to send). The Domino 6 router (R5 does not do this) will convert the Notes Rich Text formatting to HTML and send out a MIME message. This way you do not have to write the HTML/MIME and the plain text. Domino sends out a message with both the MIME/HTML and plain text and the receiving mail server chooses which version to use.

-- Howard G.


******************************************

This article just made me look fantastic to my new (2 weeks) boss. Thank you so much!

—Michael K.

******************************************

Is there a way to extract the raw HTML from the Body field of a NotesDocument? For example, If I receive an e-mail from another domain, such as Yahoo!,which is stored in the nsf file in HTML format, is there a way to extract this raw HTML out using LotusScript? Also, is there a way to convert RichText into HTML?

—Abhijeet P.

Do you have comments of your own? Let us know.


Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts