Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 330
  • Last Modified:

Sending email with Coldfusion

Hey guys,

I have an Access database with an 'email' field with address entered for client opt-in marketing for our company. How can I send a mass email (html) to all of them at once. I'm not sure about all the steps involved to acheive this. Can someone help me out? I want it to look like something similar to this:

Dear {firstname} {lastname},

HTML email body.

Sincerely,

Me

Also, will any of this be considered spam since its a "mass email"? There are about 400 clients we want to send this too. We dont want to get into any trouble. Your help is greatly appreciated!

IShiva
0
IShiva
Asked:
IShiva
  • 6
  • 5
1 Solution
 
mrichmonCommented:
You don't want to send to all at once or it WILL be considered spam.

You can send each one an individual mail and then it MAY be spam.

The key to whether or not it is spam is:

You can send a person an email if :
1) It directly relates to a transaction you had with them
2) WHen you collected their email address you told them that you might send them emails like this and gave them the option to opt out.


Those are not spam.

Otherwise it could be considered spam.

In any case you need to have a way for them to unsubscribe AND a physical contact address to follow all spam laws.


Now for how to do it.

<cfquery datasource="mydsn" name="GetEmails">
SELECT email from mytable
</cfquery>

<cfloop query="getemails">
<cfmail to="#email#" from="youremail@yourdomain.com" subject="your subject">
BODY goes here
</cfmail>
0
 
pinaldaveCommented:
Hi IShiva,
I was working in the 'newletter' *wink* company before and we used www.coolfusion.com 's IMS mail server.
It was very good and for one thread it is free also. what we did was added one more variable in all the mails so they become unique mails and not mass emails.
you can use the same idea here to add some variable in your text of the email.
well as mrichmon said if it is unsoliciated it is still a spam.

Regards,
---Pinal
0
 
IShivaAuthor Commented:
Thanks for the posts,

Pinal--can you explain a little more about this coolfusion.com? I went to their site but was confused as to what they actually do?

As for spam, the email addresses we collect are from clients that we verbally have communication with at some point. We dont ask them or they dont fill out anything to tell us that it is ok to send them emails. (although we should) These addresses are not bought, they are gathered verbally. I am not  new to spam but am new and quite confused about the laws.

mrichmon--ok that code makes sense...but how do i run it?

thanks again guys!

IShiva
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
mrichmonCommented:
"adding one more variable in all the mails so they become unique mails" does not  make it not mass email.

Most spam programs have some content change per message so it won't be *detected* as spam by the server it is being sent from, but that does not mean it is not spam and still could be illegal.


To run it you basically type the above code into your cold fusion page.

SOmething like:


<cfif isDefined("Form.SendEmail")>
<cfquery datasource="mydsn" name="GetEmails">
SELECT firstname, lastname, email from mytable
</cfquery>

<cfloop query="getemails">
<cfmail to="#email#" from="youremail@yourdomain.com" subject="your subject">

DEAR #firstName# #LastName#

#emailbody#

SIncerely,
Your Name

</cfmail>
</cfloop>
<html>
<body>
Emails sent
</body>
</html>
<cfelse>

<html>
<body>
<form action="thispage.cfm" name="myform">
Click to send the emails
<input type="submit" name="SendEmail" value="Send Email">
</form>
</body>
</html>
</cfif>
0
 
IShivaAuthor Commented:
mrichmon,

the above code works great...however i should have specified that these will be html emails. when i insert my html code, and execute the code, i get the emails...except the html code is visible...there are some links and graphics within the email that i want to send. How can i incorporate html into the above code?

sorry about that, i should have mentioned that earlier

IShiva
0
 
mrichmonCommented:
you need to add

type="html"

here:

<cfmail to="#email#" from="youremail@yourdomain.com" subject="your subject" type="html">
0
 
IShivaAuthor Commented:
ok thanks ill give it a try now
0
 
IShivaAuthor Commented:
THANKS...it works like a charm!!

I appreciate your time mrichmon

IShiva
0
 
mrichmonCommented:
no problem.

good luck :o)
0
 
IShivaAuthor Commented:
mrichmon,

one more quick question, in the line:
<cfmail to="#email#" from="youremail@yourdomain.com" subject="your subject" type="html">

do i have to put an email address in the 'from' field, or can I simply put a name....for eg:
<cfmail to="#email#" from="My Company Name" subject="your subject" type="html">

IShiva
0
 
mrichmonCommented:
You must have a valid email address or it iwll not send
0
 
IShivaAuthor Commented:
ok thanks much!

IShiva
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now