Skip to content

Instantly share code, notes, and snippets.

@ivanionut
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save ivanionut/a39cefc94d0d2642efd4 to your computer and use it in GitHub Desktop.

Select an option

Save ivanionut/a39cefc94d0d2642efd4 to your computer and use it in GitHub Desktop.
<cfscript>
// Create an instance of the mail object
mail=new mail();
// Set it's properties
mail.setSubject( "Sample Email" );
mail.setTo( "[email protected]" );
mail.setFrom( "[email protected]" );
mail.setCC( "[email protected]" );
mail.setBCC( "[email protected]" );
// Add an attachment
mail.addParam( file="C:\foo.txt" );
// Add email body content in text and HTML formats
mail.addPart( type="text", charset="utf-8", wraptext="72", body="This is a test message." );
mail.addPart( type="html", charset="utf-8", body="<p>This is a test message.</p>" );
// Send the email
mail.send();
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment