Send an Email using CFScript

	savecontent variable="mailBody"{   
		writeOutput('<h1>Hello!</h1><p>Tada it works.</p>');  
	/* create mailer service */  
	mailerService = new mail();    
	/* set mail attributes using implicit setters provided */  
	mailerService.setSubject('YOUR SUBJECT');  
	/* add mailparams */  
	/* send mail using send(). Attribute values specified in an end action like "send" will not persist after the action is performed */  
	mailerService.send(body=mailBody);  writeoutput("<h3>Thank you</h3>" & "<p>Thank you, " & mailfrom & "<br>" & "Your message, " & subject & ", has been sent to " & mailto & "</p>");

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s