Mailinglist/autoresponder

Discussion in 'ASP.NET / ASP.NET Core' started by Malin, Apr 14, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi

    Is there a way to set up a mailinglist in asp.net? I want to add mail addresses to a database and then I want them to get a copy of each message sent to a specific mail address. It is not just a "one way communication" like a newslist. Communication goes in two directions and what I dont understand is how to recieve an e-mail from asp.net code and then pass it on to all the subscribers to the mailinglist (listed in my database).

    Is this possible?
     
  2. Thanks for your answer Bruce [:)]

    Do you mean that I in my asp.net code should check a pop3 account for new e-mails and if there is one pass it on to my subscribers?

    Do you know how much bandwidth about 70 mails a day * about 60 members would require in a month?

    If so, then I have to use the scheduled task to execute the code checking for new mails..or?

    I have read more about this now and I understand that what I need is listserver functionality where all members of the list post their mails to, lets say [email protected]. All mails posted to [email protected] are then bounced to all members.

    Do you think it would be worth a try if (when [8D]) I sort out the code you gave me and combine this somehow with the scheduled task?

    Malin
     
  3. Sorry that I called you Bruce Scott [:I]
     
  4. Malin,

    Here are a few functions using the aspNet email component that is installed on DASP. Hopefully, they will be sufficient to point you in the right direction.


    <%@ Import Namespace="aspNetMime" %>
    <%@ Import Namespace="aspNetMX" %>
    <%@ Import Namespace="aspNetPop3" %>
    <%@ Import Namespace="aspNetEMail" %>

    <script language="vb" runat="server">

    dim mailserver as string = "mail.MyWebSiteName.com" ' ***** CHANGE TO YOUR INFO *****
    dim mailaccount as string = "[email protected]" ' ***** CHANGE TO YOUR INFO *****
    dim mailpassword as string = "MyPassword" ' ***** CHANGE TO YOUR INFO
    dim pop as new POP3(MailServer, MailAccount, MailPassword)
    dim LastMessageDistributed as integer = 0
    dim RecipientList as string = ""
    dim DistributedMessageList as string = "0"


    '------------------------------------------------
    sub DeleteNMessagesFromInbox(pop as pop3, n as integer)

    '--deletes all messages in the inbox of the specified pop account from the first message through message n

    dim i as integer

    pop.connect()


    for i = 0 to Getn -1
    pop.delete(i)
    next

    pop.CommitDeletes()
    pop.Disconnect()

    end sub


    '------------------------------------------------
    function GetInboxMessageCount(pop As POP3) as integer

    '--gets the number of messages currently in the specied pop account inbox

    dim Messages as integer
    pop.connect()
    pop.PopulateInboxStats()
    messages = pop.InboxMessageCount
    pop.disconnect()

    return Messages

    end function


    '------------------------------------------------
    function GetMessagesDataTable(pop as POP3, optional FirstMessage as integer = 0, optional LastMessage as integer = -1) as System.Data.DataTable

    '--returns a data table containing the specified range of messages from the inbox

    pop.Connect()
    dim dt as system.data.DataTable = pop.MessageTable(FirstMessage, LastMessage)
    pop.Disconnect()
    return dt

    end function

    </script>
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page