Difference between revisions of "Cfmail"
m (→Sending Using External SMTP: The example was missing the port and useSSL attributes which are required when sending through external servers.. ~~~~) |
(→SmarterMail SMTP Authentication for VPSs) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | == | + | __FORCETOC__ |
+ | ==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: | 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: | ||
Line 13: | Line 14: | ||
</pre> | </pre> | ||
− | == | + | ===SmarterMail SMTP Authentication for VPSs=== |
− | This second method will allow you to send through an external SMTP server such as mail.example.com. It requires | + | 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. If SMTP Authentication Bypass is needed, and cannot be avoided, the Bypass can be setup through the security settings in SmarterMail. |
+ | |||
+ | ==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: | ||
<pre> | <pre> | ||
− | <cfmail | + | <cfmail |
server="mail.example.com" | server="mail.example.com" | ||
port="25" | port="25" | ||
Line 31: | Line 35: | ||
</cfmail> | </cfmail> | ||
</pre> | </pre> | ||
+ | |||
+ | ==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: [[ColdFusion_Tips_%26_Tricks#CFMAIL_Multi-Part_Emails|CFMAIL Multi-Part Emails]] | ||
+ | |||
[[Category:ColdFusion]] | [[Category:ColdFusion]] | ||
+ | [[Category:VPS]] | ||
+ | [[Category:SmarterMail]] |
Latest revision as of 18:40, 28 June 2013
Contents
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 for 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. If SMTP Authentication Bypass is needed, and cannot be avoided, the Bypass can be setup through the security settings in SmarterMail.
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