Difference between revisions of "Cfmail"

From Hostek.com Wiki
Jump to: navigation, search
(SmarterMail SMTP Authentication Bypass for ColdFusion VPS's)
(SmarterMail SMTP Authentication Bypass for ColdFusion VPSs)
Line 15: Line 15:
  
 
===SmarterMail SMTP Authentication Bypass for ColdFusion VPSs===
 
===SmarterMail SMTP Authentication Bypass for ColdFusion VPSs===
To use cfmail and Default SMTP from ColdFusion VPS servers with SmarterMail, 'SMTP Authentication Bypass' needs to be enabled. To use SMTP Authentication Bypass, for cfmail - without authentication, go to Security>>SMTP Authentication Bypass and enter the server's IP address and the localhost IP address of 127.0.0.1.
+
For security reasons it is the best practice to use SMTP Authentication for all scripts, either with SmarterMail on the VPS or an External SMTP Server, this is to prevent unauthorized emails being sent from the VPS.
 
+
NOTE: For security reasons it is the best practice to use SMTP Authentication for all cfmail, either with SmarterMail on the VPS or an External SMTP Server, this it to prevent unauthorized emails being sent from the VPS (See the below settings). By default, New ColdFusion 10 Servers with SmarterMail has this disabled.
+
  
 
==Using CFMAIL with External SMTP==
 
==Using CFMAIL with External SMTP==

Revision as of 17:50, 28 June 2013

Using CFMAIL with 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>

SmarterMail SMTP Authentication Bypass for ColdFusion VPSs

For security reasons it is the best practice to use SMTP Authentication for all scripts, either with SmarterMail on the VPS or an External SMTP Server, this is to prevent unauthorized emails being sent from the VPS.

Using CFMAIL with 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 Both Text and HTML Email Parts using CFMAIL

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