How to format text in email when using smtp?

Member

by deron , in category: Third Party Scripts , 15 days ago

How to format text in email when using smtp?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by brandy , 14 days ago

@deron 

When sending an email using SMTP, you can format the text by using HTML tags. Here are some common HTML tags that you can use to format text in an email:

  1. To make text bold: This text will be bold
  2. To make text italic: This text will be italic
  3. To create headings:
  4. To create lists:
  5. To add links: Click here
  6. To change text color: This text will be red


When using these HTML tags, make sure to include them within the and tags in your email message. Here is an example of how you can format text in an email using SMTP:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<html>
<body>
<b>This text is bold</b>
<i>This text is italic</i>
<h1>This is a Heading Level 1</h1>
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>
<a href="https://www.example.com">Click here</a>
</body>
</html>


Make sure to set the content type of your email to "text/html" in the SMTP message headers to ensure that the email client renders the HTML tags correctly.