Solution needed

Discussion in 'ASP General' started by Slim, Aug 21, 2005.

  1. Slim

    Slim Guest

    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?
    Slim, Aug 21, 2005
    #1
    1. Advertising

  2. Slim

    Bullschmidt Guest

    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?
    >>



    *** Sent via Developersdex http://www.developersdex.com ***
    Bullschmidt, Aug 22, 2005
    #2
    1. Advertising

  3. Slim

    Slim Guest

    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


    "Bullschmidt" <-nospam> wrote in message
    news:...
    > 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?
    > >>

    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    Slim, Aug 22, 2005
    #3
  4. Slim

    Bullschmidt Guest

    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
    >>




    *** Sent via Developersdex http://www.developersdex.com ***
    Bullschmidt, Aug 22, 2005
    #4
  5. Slim

    Slim Guest

    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?


    "Bullschmidt" <-nospam> wrote in message
    news:...
    > 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
    > >>

    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    Slim, Aug 23, 2005
    #5
  6. Slim

    Jeff Cochran Guest

    On Sun, 21 Aug 2005 20:38:46 +0800, "Slim" <> wrote:

    >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
    Jeff Cochran, Aug 25, 2005
    #6
  7. "Slim" <> wrote in message
    news:...
    >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
    Chris Hohmann, Aug 25, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Francis
    Replies:
    0
    Views:
    395
    Andrew Francis
    Jun 28, 2006
  2. =?Utf-8?B?Y2FzaGRlc2ttYWM=?=

    Solution file not in the solution folder

    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=, Sep 12, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,084
    Laurent Bugnion
    Sep 12, 2006
  3. , India
    Replies:
    17
    Views:
    1,020
    James Kanze
    Oct 1, 2007
  4. Replies:
    8
    Views:
    493
  5. email55555 email55555

    [SOLUTION] Ruby Quiz #14 LCD Numbers ( solution #2 )

    email55555 email55555, Jan 9, 2005, in forum: Ruby
    Replies:
    16
    Views:
    262
    David Tran
    Jan 10, 2005
Loading...

Share This Page