Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending mail to one group email address

Status
Not open for further replies.

karren

Programmer
Feb 26, 2002
42
CA
hey all,

I am workign on sending a newsletter to a list of emails from a database. instead of sending each person in the database an email at their individual address, I want to send them an email where a single email such as "to: groups@yahoo.com" appears the "to:" field when the user receives the newsletter. bascially, i want to create a group email address where i send the newsletter to as they do in some mailing lists (for example, when you join a yahoo! group and receive mail from that group, it is addressed to groupname@yahoogroups.com instead of the person's email address).

i was wondering if this is possible to do??

thanks all!

karren
 
Well if your host allows you to setup an email adddress that redirects to multipe email addresses then it is very possible.. otherwise what I would do.. is fake it..

Create one email address.. let's say.. "list@mycfdomain.com".. Setup an auto-responder if you can so that any email to list@mycfdomain.com recieves a "You are not authorized to post to this list." message.. and then my cfcode would look like this:

Code:
<CFQUERY name=&quot;GetE&quot; datasource=&quot;#request.dsn#&quot;>
 SELECT Email from EmailTable
</CFQUERY>

<CFMAIL to=&quot;list@mycfdomain.com&quot; bcc=&quot;#ValueList(GetE.Email)#&quot; subject=&quot;Sample mailing&quot; server=&quot;enter.smtp.server.here&quot;>...</CFMAIL>

Tony Did I help?
Vote!
 
Thats great.. but some email servers cannot handle a lot of emails all in the BCC feild. Slows it down hard and fast.

You might want to simply break it up to send one email at a time to everyone using a loop over the cfmail.


<CFQUERY name=&quot;GetE&quot; datasource=&quot;#request.dsn#&quot;>
SELECT Email from EmailTable
WHERE OPT_IN = 1
</CFQUERY>

<cfoutput query=&quot;GetE&quot;>
<CFMAIL to=&quot;#Email#&quot; from=&quot;list@mycfdomain.com&quot; subject=&quot;Sample mailing&quot; server=&quot;enter.smtp.server.here&quot;>...</CFMAIL>
</cfoutput >

<!--- Send a copy to you --->
<CFMAIL to=&quot;list@mycfdomain.com&quot; from=&quot;list@mycfdomain.com&quot; subject=&quot;Sample mailing&quot; server=&quot;enter.smtp.server.here&quot;>...

The above email went to:
#ValueList(GetE.Email)#

</CFMAIL>

I added an OPT_IN check in the DB.. since you might want to only send to people that opt in..

Also.. a copy is sent to you that shows who it went to if that is useful. As an archive record.


David McIntosh

Let me know if this post helped you...
Please click below: &quot;This Post was Helpful&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top