Using Different Transports

HTML E-Mail

To send an e-mail in HTML format, set the body using the method setBodyHTML() instead of setBodyText(). The MIME content type will automatically be set to text/html then. If you use both HTML and Text bodies, a multipart/alternative MIME message will automatically be generated:

Example #1 Sending HTML E-Mail

  1. span style="color: #ff0000;">'My Nice Test Text''My Nice <b>Test</b> Text''[email protected]', 'Some Sender''[email protected]', 'Some Recipient''TestSubject'

Using Different Transports