Solution needed

S

Slim

I am building a web site where people can register for a newsletter. when
they register they enter a email address into the database so we can send
the news letter to them.
Now what I want to do is for the owner of the site to be able to email a
HTML email to the server (win 2000 with exchange) and then forward the email
to all addresses in the database.

Can I get hold of the email though a data connection? Or can I add the
addresses to a group and then send from exchange?

any ideas?
 
B

Bullschmidt

I'd suggest having a table with a field to store the body of the e-mail
and perhaps the date and perhaps an IsSent field or something.

And create a Web page for the owner of the site to enter the relevant
data for the e-mail and perhaps have a page to be able to view the
e-mail in HTML format and then of course have a Send button...

How do I send e-mail with CDO?
http://www.aspfaq.com/show.asp?id=2026

VBScript To Send Email Using CDO
http://www.paulsadowski.com/WSH/cdo.htm

How do I send e-mail from ASP?
http://www.aspfaq.com/show.asp?id=2119

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...

<<
I am building a web site where people can register for a newsletter.
when
they register they enter a email address into the database so we can
send
the news letter to them.
Now what I want to do is for the owner of the site to be able to email a
HTML email to the server (win 2000 with exchange) and then forward the
email
to all addresses in the database.

Can I get hold of the email though a data connection? Or can I add the
addresses to a group and then send from exchange?
 
S

Slim

i think you miss my pint,

the author of the newsletter, wants to compil the newsletter in word from a
remote location and email it to the others, so how do i get that email to go
to all on the database list

thanks
 
B

Bullschmidt

Here's a snippet of code I've used for putting users' e-mail addresses
into a comma separated string.

' *** Build strUserEmails - E-mail addresses separated by comma and
space.
' Set sql.
strSQL = "SELECT UserEmail "
strSQL = strSQL & "FROM tblUser "
strSQL = strSQL & "WHERE (1=1) "
strSQL = strSQL & " AND ( "
' EquipUser level user shown in EquipEvent.EquipEventUserID if there
is one.
If EquipEventUserID <> "" Then
strSQL = strSQL & "( "
strSQL = strSQL & "(UserLevel=" & Chr(39) & "EquipUser" & Chr(39) &
") "
strSQL = strSQL & " AND (UserID=" & Chr(39) &
jpsvbFixSQL(EquipEventUserID) & Chr(39) & ") "
strSQL = strSQL & ") "
End If
' EquipAdmin level users.
strSQL = strSQL & " OR (UserLevel=" & Chr(39) & "EquipAdmin" &
Chr(39) & ") "
' Admin level users.
strSQL = strSQL & " OR (UserLevel=" & Chr(39) & "Admin" & Chr(39) &
") "
strSQL = strSQL & ") "
strSQL = strSQL & " AND (UserEmail Is Not Null) "
strSQL = strSQL & " AND (UserIsEmailNotif=True) "
strSQL = strSQL & "ORDER BY UserLName, UserFName "

' Open rs.
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn

' If no recs.
If objRS.EOF Then
' Close rs.
objRS.Close
Set objRS = Nothing

Exit Function
Else
' Put recs into array for speed.
arrayRS = objRS.GetRows

' Close rs.
objRS.Close
Set objRS = Nothing

' Init.
strUserEmails = ""

' Loop thru rows (i.e. recs).
For I = 0 To UBound(arrayRS, 2)
' Set var using each fld's col num.
UserEmail = jpsvbNullToBlank(arrayRS(0, I))
strUserEmails = strUserEmails & ", " & UserEmail
Next

' Remove initial comma and space.
strUserEmails = Right(strUserEmails, Len(strUserEmails) - 2)
End If

And here's a good reference for sending an e-mail attachment such as a
Word doc (although of course some users' computers might not allow a
Word doc to come through without special consideration since it could
contain macros:

Email (with Attachment)
http://www.asp101.com/samples/email_attach.asp

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...

<<
the author of the newsletter, wants to compil the newsletter in word
from a
remote location and email it to the others, so how do i get that email
to go
to all on the database list
 
S

Slim

You are still missing my point

I can handle the seding of emails,

What im am having a problem with is the trigger, the author of the newsleter
emailes his email to a exhcnage server, how do i then get that email to all
on the list? seeing that the list is not in exchange but in a SQL database?
 
J

Jeff Cochran

I am building a web site where people can register for a newsletter. when
they register they enter a email address into the database so we can send
the news letter to them.
Now what I want to do is for the owner of the site to be able to email a
HTML email to the server (win 2000 with exchange) and then forward the email
to all addresses in the database.

Can I get hold of the email though a data connection? Or can I add the
addresses to a group and then send from exchange?

any ideas?

Look at any mailing list software.

Jeff
 
C

Chris Hohmann

Slim said:
I am building a web site where people can register for a newsletter. when
they register they enter a email address into the database so we can send
the news letter to them.
Now what I want to do is for the owner of the site to be able to email a
HTML email to the server (win 2000 with exchange) and then forward the
email
to all addresses in the database.

Can I get hold of the email though a data connection? Or can I add the
addresses to a group and then send from exchange?

any ideas?

1. You could access the message store via the IMessages interface in CDOEX,
find the message in question, retrieve the body of the message and then use
CDO to construct a new mail message using the retrieved body and a recipient
list generated from the address stored in your database.

Here's the link to the IMessages interface in CDOEX:
http://msdn.microsoft.com/library/en-us/e2k3/e2k3/_cdo_imessages_interface.asp

Here's the link to the CDO documentation:
http://msdn.microsoft.com/library/en-us/cdosys/html/18f3a81f-f4b3-4ae3-8761-d2775976c12f.asp

2. You could use the OLE-DB Provider for Exchange to treat the message store
as a data source, then similar to option 1 you could retrieve the message
body and use CDO to construct a new message using the retrieved body and a
recipient list constructed from the addresses stored in your database.
Here's a link to an example of a connection string using the provider for
Exchange:

http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForExchange

3. Create a filter on the exchange account that receives the administrators
email and use the "start application" action to pass the message body to a
custom windows shell script that does the same thing as options 1 and 2,
namely use CDO to construct a new mail message using the passed in body and
a recipient list generated from the address stored in your database. Here's
a link to the Windows Scripting Host documentation:
http://msdn.microsoft.com/library/en-us/script56/html/wsoriWindowsScriptHost.asp

HTH
-Chris Hohmann
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top