Cfmail

From Hostek.com Wiki
Revision as of 19:47, 5 November 2012 by Jakeh (Talk | contribs)

Jump to: navigation, search

Sending Using Default SMTP

This method will allow you to send through the servers default SMTP server. You'll need to make sure and leave out the server, username, and password attributes when using this method as shown below:

<cfmail
  from="#from#"
  to="#to#"
  subject="Sample CF e-mail">

This is the body of a test email.

</cfmail>

Sending Using External SMTP

This second method will allow you to send through an external SMTP server such as mail.example.com. It requires specifying the server, port, useSSL, username, and password attributes as shown below:

<cfmail.
  server="mail.example.com"
  port="25"
  useSSL="false"
  username="example@example.com"
  password="mySecretPassword!"
  from="#from#"
  to="#to#"
  subject="Sample CF e-mail">

This is the body of a test email.

</cfmail>

Sending Text and HTML Parts

Including both TEXT and HTML parts in your emails will help lower a messages spam score and reduce the likelihood of it being considered spam by another mail provider. Instructions on how to add TEXT and HTML parts to your emails are here: CFMAIL Multi-Part Emails