Using CFMail Print

  • 70

If you would like to use CFMAIL tag in your application you will need to set a username / password and a server in the CFMAIL tag. The from email address is recommended to be an email address on the server that is listed in the "server" option as some mail services will block it. You can use the reply-to option to ensure any replies go to the correct email address. The username and password must be for a valid email address setup within your cPanel control panel (Email Accounts) or the mail server you are pointing too. You can add new email accounts in cPanel easily by logging into your cPanel control panel or your email service provider.

Example script using CFMAIL:

<cfmail to="[email protected]" replyto="[email protected]" from="[email protected]" subject="My Subject" server="localhost" username="[email protected]" password="email-password">
Hello, this is my email!
</cfmail>

If your mail service is a remote email service provide please ensure the server setting is set to the mail servers IP or mail domain.

For more code examples check out our Gibhub repo: https://github.com/hostmedia/ColdFusionExamples/


Was this answer helpful?

« Back